164#if VERSION_STRING > TBC
178 std::string characterNameDB = fields[1].
asCString();
181 name = characterNameDB;
203 m_updateMgr(this, static_cast<size_t>(
worldConfig.server.compressionThreshold), 40000, 30000, 1000),
224#if VERSION_STRING >= WotLK
240#if VERSION_STRING > TBC
242 m_achievementMgr = std::unique_ptr<AchievementMgr>(
new AchievementMgr(
this));
244 m_taxi = std::make_unique<TaxiPath>();
250#if VERSION_STRING >= Cata
251 std::fill(_voidStorageItems.begin(), _voidStorageItems.end(),
nullptr);
262 sLogger.failure(
"Player deleted from non-logout player!");
277 inviterPlayer->setGroupInviterId(0);
419 if (itr->second < now)
500#if VERSION_STRING > TBC
509 auto t_loc = transport->GetPosition();
510 this->
SetPosition(t_loc.x + this->GetTransOffsetX(),
511 t_loc.y + this->GetTransOffsetY(),
512 t_loc.z + this->GetTransOffsetZ(),
513 this->GetOrientation(),
false);
533#if VERSION_STRING > TBC
541#if VERSION_STRING > TBC
542 m_achievementMgr->sendAllAchievementData(
this);
550#if VERSION_STRING >= WotLK
614 startlevel =
static_cast<uint8_t>(std::max(55,
worldConfig.player.playerStartingLevel));
633#if VERSION_STRING >= WotLK
640#if VERSION_STRING >= Cata
687#if VERSION_STRING == Mop
773#if VERSION_STRING == TBC
790#if VERSION_STRING < Cata
798#if VERSION_STRING < Cata
815#if VERSION_STRING >= Cata
864#if VERSION_STRING >= TBC
880#if VERSION_STRING > Classic
897#if VERSION_STRING > TBC
900#elif VERSION_STRING == TBC
924#if VERSION_STRING > TBC
937 write(
playerData()->visible_items[slot].enchantment.raw[pos], enchantment);
960#if VERSION_STRING < Cata
965#if VERSION_STRING == TBC
970#if VERSION_STRING == WotLK
978#if VERSION_STRING > Classic
983#if VERSION_STRING > Classic
988#if VERSION_STRING == WotLK
1000#if VERSION_STRING < Cata
1032#if VERSION_STRING < Cata
1039#if VERSION_STRING < Cata
1045#if VERSION_STRING < Cata
1057#if VERSION_STRING < Cata
1090#if VERSION_STRING >= TBC
1106#if VERSION_STRING >= TBC
1117#if VERSION_STRING >= WotLK
1141#if VERSION_STRING == TBC
1151#if VERSION_STRING > Classic
1160#if VERSION_STRING > Classic
1167#if VERSION_STRING >= WotLK
1175#if VERSION_STRING < Cata
1193#if VERSION_STRING == Classic
1212#if VERSION_STRING >= TBC
1237#if VERSION_STRING < Cata
1248#if VERSION_STRING > Classic
1253#if VERSION_STRING > Classic
1254#if VERSION_STRING < Cata
1255 uint32_t Player::getContributionToday()
const {
return playerData()->field_contribution_today; }
1256 void Player::setContributionToday(
uint32_t contribution) {
write(
playerData()->field_contribution_today, contribution); }
1258 uint32_t Player::getContributionYesterday()
const {
return playerData()->field_contribution_yesterday; }
1259 void Player::setContributionYesterday(
uint32_t contribution) {
write(
playerData()->field_contribution_yesterday, contribution); }
1266#if VERSION_STRING != Mop
1280#if VERSION_STRING > Classic
1282uint32_t Player::getArenaTeamId(
uint8_t teamSlot)
const {
return playerData()->field_arena_team_info[teamSlot].team_id; }
1285uint32_t Player::getArenaTeamMemberRank(
uint8_t teamSlot)
const {
return playerData()->field_arena_team_info[teamSlot].member_rank; }
1290#if VERSION_STRING > Classic
1291#if VERSION_STRING < Cata
1292uint32_t Player::getHonorCurrency()
const {
return playerData()->field_honor_currency; }
1294void Player::modHonorCurrency(
int32_t value) { setArenaCurrency(getArenaCurrency() +
value); }
1296uint32_t Player::getArenaCurrency()
const {
return playerData()->field_arena_currency; }
1298void Player::modArenaCurrency(
int32_t value) { setArenaCurrency(getArenaCurrency() +
value); }
1302#if VERSION_STRING >= WotLK
1320#if VERSION_STRING >= Cata
1401#if VERSION_STRING == Mop
1419 data << float(speed);
1457#if VERSION_STRING == Mop
1458 data << float(speed);
1539 if (
const auto at =
GetArea())
1548 return (areaIsCity || zoneIsCity);
1592#if VERSION_STRING <= WotLK
1609 if (movementInfo.
getPosition()->
z + m_noseLevel < session->m_wLevel)
1685#if VERSION_STRING >= Cata
1699#if VERSION_STRING > Classic
1713#if VERSION_STRING >= Cata
1726 if (
object ==
nullptr)
1733 float sin = sinf(angle);
1734 float cos = cosf(angle);
1746 if (
map->getPlayer(this->getGuidLow()))
1775 if (
const auto mapInfo =
sMySQLStore.getWorldMapInfo(mapId))
1798 if (
m_taxi->getCurrentTaxiPath())
1813 transporter->RemovePassenger(
this);
1818 bool instance =
false;
1897#if VERSION_STRING < Cata
1961#if VERSION_STRING < TBC
1983#if VERSION_STRING == TBC
2002 if (mapDiff->resetTime)
2025 if (
worldConfig.terrainCollision.isCollisionEnabled)
2069#if VERSION_STRING == WotLK
2071#elif VERSION_STRING > WotLK
2079 if (phase->PhaseShift == newPhase)
2081 phaseFlags = phase->Flags;
2094 charm->setPhase(command, newPhase);
2131 if (target !=
nullptr && target !=
m_duelPlayer && target !=
this)
2146 sLogger.failure(
"Player with invalid player_info tries to call Player::zoneUpdate()!");
2156 if (
auto areaTableEntry = this->
GetArea())
2158 if (areaTableEntry->zone && areaTableEntry->zone !=
m_zoneId)
2174 return (currFields & val) != 0;
2214 if (
auto areaTableEntry = this->
GetArea())
2216 uint16_t offset =
static_cast<uint16_t>(areaTableEntry->explore_flag / 32);
2220 if (areaTableEntry->id !=
m_areaId)
2231 if (areaTableEntry->zone == 0 &&
m_zoneId != areaTableEntry->id)
2233 else if (areaTableEntry->zone != 0 &&
m_zoneId != areaTableEntry->zone)
2237 if (areaTableEntry->zone != 0 &&
m_zoneId != areaTableEntry->zone)
2240 bool rest_on =
false;
2253 if (areaTableEntry->zone)
2281 uint32_t explore_xp = areaTableEntry->area_level * 10;
2284#if VERSION_STRING > TBC
2285 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EXPLORE_AREA,
getAreaId());
2291 giveXp(explore_xp, 0,
false);
2432#if VERSION_STRING > TBC
2434 sLogger.failure(
"Account Name: {} tried to create a deathknight, however your playercreateinfo table does not support this class, please update your database.",
m_session->
GetAccountName());
2437 sLogger.failure(
"Account Name: {} tried to create an invalid character with race {} and class {}, if this is intended please update your playercreateinfo table inside your database.",
m_session->
GetAccountName(), charCreateContent.
_race, charCreateContent.
_class);
2442#if VERSION_STRING > Classic
2452#if VERSION_STRING > TBC
2477 sCheatLog.writefromsession(
m_session,
"tried to create invalid player with race %u and class %u, dbc m_playerCreateInfo not found", charCreateContent.
_race, charCreateContent.
_class);
2491 if (
auto playerClassLevelStats =
sMySQLStore.getPlayerClassLevelStats(1, charCreateContent.
_class))
2494 sLogger.failure(
"No class levelstats found!");
2501#if VERSION_STRING > TBC
2507#if VERSION_STRING > TBC
2558 if (charStartOutfitEntry->ItemId[j] <= 0)
2561 const uint32_t itemId = charStartOutfitEntry->ItemId[j];
2563 const auto itemProperties =
sMySQLStore.getItemProperties(itemId);
2564 if (!itemProperties)
2566 sLogger.debug(
"StartOutfit - Item with entry {} not in item_properties table but in CharStartOutfit.dbc!", itemId);
2570 auto item =
sObjectMgr.createItem(itemId,
this);
2573 item->setStackCount(1);
2578 if (itemProperties->InventoryType == 0)
2580 if (
const auto itemDB2Properties =
sItemStore.lookupEntry(itemId))
2594 sLogger.debug(
"StartOutfit - Item with entry {} can not be added safe to slot {}!", itemId,
static_cast<uint32_t>(itemSlot));
2603 sLogger.debug(
"StartOutfit - Item with entry {} can not be added to a free slot!", itemId);
2614 auto item =
sObjectMgr.createItem((*is).id,
this);
2617 item->setStackCount((*is).amount);
2660 sLogger.failure(
"Gender {} is not valid for Player charecters!", gender);
2671 const auto previousLevel =
getLevel();
2695#if VERSION_STRING >= WotLK
2707#if VERSION_STRING >= WotLK
2722#if VERSION_STRING >= TBC
2731 else if (newLevel != previousLevel)
2736#if VERSION_STRING >= WotLK
2738 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL);
2748 const auto pet =
getPet();
2749 if (pet !=
nullptr && pet->IsInWorld() && pet->isAlive())
2751 pet->setLevel(newLevel);
2752 pet->applyStatsForLevel();
2753 pet->updateSpellList();
2889 auto result =
CharacterDatabase.Query(
"SELECT bytes2 FROM `characters` WHERE guid = '%u'",
static_cast<uint32_t>(guid));
2893 Field* fields = result->Fetch();
2896 player_bytes2 &= ~0xFF;
2897 player_bytes2 |= facialHair;
2899 CharacterDatabase.Execute(
"UPDATE `characters` SET gender = '%u', bytes = '%u', bytes2 = '%u' WHERE guid = '%u'", gender, skin | (face << 8) | (hairStyle << 16) | (hairColor << 24), player_bytes2, (
uint32_t)guid);
2934#if VERSION_STRING >= TBC
2938#if VERSION_STRING >= Cata
2944#if VERSION_STRING >= Mop
2957#if VERSION_STRING < TBC
2958 CharacterDatabase.Execute(
"DELETE FROM `playerspells` WHERE GUID = '%u' AND SpellID IN ('%u', '%u', '%u', '%u', '%u','%u', '%u', '%u', '%u');",
static_cast<uint32_t>(guid), getSpellIdForLanguage(
SKILL_LANG_ORCISH), getSpellIdForLanguage(
SKILL_LANG_TAURAHE), getSpellIdForLanguage(
SKILL_LANG_TROLL), getSpellIdForLanguage(
SKILL_LANG_GUTTERSPEAK), getSpellIdForLanguage(
SKILL_LANG_THALASSIAN), getSpellIdForLanguage(
SKILL_LANG_COMMON), getSpellIdForLanguage(
SKILL_LANG_DARNASSIAN), getSpellIdForLanguage(
SKILL_LANG_DWARVEN), getSpellIdForLanguage(
SKILL_LANG_GNOMISH));
2959#elif VERSION_STRING < Cata
2960 CharacterDatabase.Execute(
"DELETE FROM `playerspells` WHERE GUID = '%u' AND SpellID IN ('%u', '%u', '%u', '%u', '%u','%u', '%u', '%u', '%u', '%u');",
static_cast<uint32_t>(guid), getSpellIdForLanguage(
SKILL_LANG_ORCISH), getSpellIdForLanguage(
SKILL_LANG_TAURAHE), getSpellIdForLanguage(
SKILL_LANG_TROLL), getSpellIdForLanguage(
SKILL_LANG_GUTTERSPEAK), getSpellIdForLanguage(
SKILL_LANG_THALASSIAN), getSpellIdForLanguage(
SKILL_LANG_COMMON), getSpellIdForLanguage(
SKILL_LANG_DARNASSIAN), getSpellIdForLanguage(
SKILL_LANG_DRAENEI), getSpellIdForLanguage(
SKILL_LANG_DWARVEN), getSpellIdForLanguage(
SKILL_LANG_GNOMISH));
2961#elif VERSION_STRING == Cata
2962 CharacterDatabase.Execute(
"DELETE FROM `playerspells` WHERE GUID = '%u' AND SpellID IN ('%u', '%u', '%u', '%u', '%u','%u', '%u', '%u', '%u', '%u');",
static_cast<uint32_t>(guid), getSpellIdForLanguage(
SKILL_LANG_ORCISH), getSpellIdForLanguage(
SKILL_LANG_TAURAHE), getSpellIdForLanguage(
SKILL_LANG_TROLL), getSpellIdForLanguage(
SKILL_LANG_GUTTERSPEAK), getSpellIdForLanguage(
SKILL_LANG_THALASSIAN), getSpellIdForLanguage(
SKILL_LANG_COMMON), getSpellIdForLanguage(
SKILL_LANG_DARNASSIAN), getSpellIdForLanguage(
SKILL_LANG_DRAENEI), getSpellIdForLanguage(
SKILL_LANG_DWARVEN), getSpellIdForLanguage(
SKILL_LANG_GNOMISH), getSpellIdForLanguage(
SKILL_LANG_GILNEAN), getSpellIdForLanguage(
SKILL_LANG_GOBLIN));
2963#elif VERSION_STRING == Mop
2964 CharacterDatabase.Execute(
"DELETE FROM `playerspells` WHERE GUID = '%u' AND SpellID IN ('%u', '%u', '%u', '%u', '%u','%u', '%u', '%u', '%u', '%u');",
static_cast<uint32_t>(guid), getSpellIdForLanguage(
SKILL_LANG_ORCISH), getSpellIdForLanguage(
SKILL_LANG_TAURAHE), getSpellIdForLanguage(
SKILL_LANG_TROLL), getSpellIdForLanguage(
SKILL_LANG_GUTTERSPEAK), getSpellIdForLanguage(
SKILL_LANG_THALASSIAN), getSpellIdForLanguage(
SKILL_LANG_COMMON), getSpellIdForLanguage(
SKILL_LANG_DARNASSIAN), getSpellIdForLanguage(
SKILL_LANG_DRAENEI), getSpellIdForLanguage(
SKILL_LANG_DWARVEN), getSpellIdForLanguage(
SKILL_LANG_GNOMISH), getSpellIdForLanguage(
SKILL_LANG_GILNEAN), getSpellIdForLanguage(
SKILL_LANG_GOBLIN), getSpellIdForLanguage(
SKILL_LANG_PANDAREN_NEUTRAL), getSpellIdForLanguage(
SKILL_LANG_PANDAREN_ALLIANCE), getSpellIdForLanguage(
SKILL_LANG_PANDAREN_HORDE));
2972#if VERSION_STRING > Classic
2998#if VERSION_STRING > Classic
3004#if VERSION_STRING >= Cata
3014#if VERSION_STRING >= Mop
3036#if VERSION_STRING == Mop
3100 std::vector<uint32_t> tutorials;
3102 tutorials.push_back(tutorial);
3106#if VERSION_STRING > TBC
3121#if VERSION_STRING > TBC
3126 sLogger.info(
"WORLD: Sent initial logon packets for {}.",
getName());
3177 if (
Player* player =
static_cast<Player*
>(objectPlayer))
3181 if (player->getSession()->hasPermissions())
3182 player->outPacket(opcode, length, data);
3186 player->outPacket(opcode, length, data);
3202 if (
Player* player =
static_cast<Player*
>(objectPlayer))
3204 if (player->getSession() ==
nullptr)
3207 if (sendToOwnTeam && player->getTeam() !=
getTeam())
3210 if ((player->GetPhase() &
GetPhase()) == 0)
3218 if (player->isVisibleObject(
getGuid()))
3219 player->sendPacket(data);
3224 player->sendPacket(data);
3232 if (data ==
nullptr)
3238 if (deleteDataOnSend)
3244 uint32_t destsize = size + size / 10 + 16;
3246 if (size >= 40000 && rate < 6)
3252 stream.
zfree =
nullptr;
3257 sLogger.failure(
"deflateInit failed.");
3261 auto buffer = std::make_unique<uint8_t[]>(destsize);
3273 sLogger.failure(
"deflate failed.");
3280 sLogger.failure(
"deflate failed: did not end stream");
3287 sLogger.failure(
"deflateEnd failed.");
3294#if VERSION_STRING < Cata
3318#if VERSION_STRING == Mop
3419#if VERSION_STRING < Cata
3440#if VERSION_STRING == WotLK
3451#if VERSION_STRING == WotLK
3460#if VERSION_STRING <= TBC
3473#if VERSION_STRING != Classic
3492#if VERSION_STRING > TBC
3504#if VERSION_STRING < Cata
3512#if VERSION_STRING == TBC
3523#if VERSION_STRING > TBC
3533#if VERSION_STRING == Classic
3535#elif VERSION_STRING == TBC
3544#if VERSION_STRING != Classic
3567 updateMask->
SetBit(index);
3593#if VERSION_STRING <= TBC
3606#if VERSION_STRING <= TBC
3625 sLogger.failure(
"Major error in Player::setInitialPlayerData : No LevelInfo for player (level {}, race {}, class {})!",
getLevel(),
getRace(),
getClass());
3645#if VERSION_STRING >= Cata
3655#if VERSION_STRING >= WotLK
3664#if VERSION_STRING >= Cata
3708#if VERSION_STRING >= TBC
3714#if VERSION_STRING >= WotLK
3718#if VERSION_STRING >= TBC
3733#if VERSION_STRING >= TBC
3742#if VERSION_STRING >= WotLK
3743 for (
uint8_t i = 0; i < WOWPLAYER_NO_REAGENT_COST_COUNT; ++i)
3763#if VERSION_STRING == TBC
3765#elif VERSION_STRING >= WotLK
3775#if VERSION_STRING >= WotLK
3783#if VERSION_STRING < WotLK
3785 m_rageRegenerateTimer += diff;
3786 if (m_rageRegenerateTimer >= REGENERATION_INTERVAL_RAGE)
3789 m_rageRegenerateTimer = 0;
3793#if VERSION_STRING >= Cata
3811 const auto findFoodOrDrinkAura = [
this](
AuraEffect auraEffect) ->
bool
3815 if (aurEff->getAura()->IsPassive() || aurEff->getAura()->isNegative())
3837#if VERSION_STRING >= Cata
3857 if (result ==
nullptr)
3862 const auto fields = result->
Fetch();
3863 const auto spellId = fields[0].
asUint32();
3874 if (result ==
nullptr)
3879 const auto fields = result->
Fetch();
3881 const auto skillid = fields[0].
asUint16();
3882 const auto currval = fields[1].asUint16();
3883 const auto maxval = fields[2].asUint16();
3900 if (result ==
nullptr)
3908 const auto flag =
field[1].asUint8();
3909 const auto basestanding =
field[2].asInt32();
3910 const auto standing =
field[3].asInt32();
3913 if (faction ==
nullptr || faction->RepListId < 0)
3916 const auto [repItr, _] =
m_reputation.insert_or_assign(
id, std::make_unique<FactionReputation>(standing, flag, basestanding));
3937 _addSpell(spellId, fromSkill,
false,
false);
3947 return _removeSpell(spellId, moveToDeleted,
false,
false,
false);
3978 smsgInitialSpells.addSpellIds(spellId);
3985 if (itr2->second.ExpireTime < mstime || (itr2->second.ExpireTime - mstime) < 10000)
3991 sLogger.debug(
"InitialSpells sending spell cooldown for spell {} to {} ms", itr2->first, itr2->second.ExpireTime - mstime);
3993 smsgInitialSpells.addSpellCooldown(itr2->first, itr2->second.ItemId, 0, itr2->second.ExpireTime - mstime, 0);
3998 PlayerCooldownMap::iterator itr2 = itr++;
4000 if (itr2->second.ExpireTime < mstime || (itr2->second.ExpireTime - mstime) < 10000)
4006 sLogger.debug(
"InitialSpells sending category cooldown for cat {} to {} ms", itr2->first, itr2->second.ExpireTime - mstime);
4008 smsgInitialSpells.addSpellCooldown(itr2->first, itr2->second.ItemId,
static_cast<uint16_t>(itr2->first), 0, itr2->second.ExpireTime - mstime);
4016 std::vector<SmsgSpellCooldownMap> spellCoodlownMap;
4020 if (
const auto* spellInfo =
sSpellMgr.getSpellInfo(SpellId))
4026 if (spellInfo->getFirstSchoolFromSchoolMask() == spellSchool)
4029 smsgSpellCooldownMap.
spellId = SpellId;
4030 smsgSpellCooldownMap.
duration = timeMs;
4032 spellCoodlownMap.push_back(smsgSpellCooldownMap);
4043 std::list<uint32_t> spelllist;
4046 spelllist.push_back(spellId);
4048 for (std::list<uint32_t>::iterator itr = spelllist.begin(); itr != spelllist.end(); ++itr)
4053 for (std::set<uint32_t>::iterator sp = playerCreateInfo->spell_list.begin(); sp != playerCreateInfo->spell_list.end(); ++sp)
4068 Spell* spell =
sSpellMgr.newSpell(
this, spellInfo,
true,
nullptr);
4070 spell->
prepare(&spellCastTargets);
4089 if (!shapeshiftFormEntry)
4094 for (
uint8_t i = 0; i < 8; ++i)
4096#if VERSION_STRING >= TBC
4124#if VERSION_STRING >= TBC
4133 if (!(shapeshift->
Flags & 0x1))
4151 if (model && !(model->
Flags & 0x80))
4152 if (race && !(race->
flags & 0x4))
4172 const auto isAutoShot = autoRepeatSpell->getSpellInfo()->getId() == 75;
4192 const auto canCastAutoRepeatSpell = autoRepeatSpell->canCast(
true, 0, 0);
4198 autoRepeatSpell->sendCastResult(canCastAutoRepeatSpell);
4203 const auto newAutoRepeatSpell =
sSpellMgr.newSpell(
this, autoRepeatSpell->getSpellInfo(),
true,
nullptr);
4204 newAutoRepeatSpell->prepare(&autoRepeatSpell->m_targets);
4212#if VERSION_STRING == Classic
4216 if (areaEntry ==
nullptr)
4219 if (areaEntry ==
nullptr)
4228 if (mapId == 530 || mapId == 571)
4231 if (worldMapEntry !=
nullptr)
4232 mapId = worldMapEntry->continentMapId >= 0 ? worldMapEntry->continentMapId : worldMapEntry->mapId;
4273 const auto spellSkillRange =
sSpellMgr.getSkillEntryRangeForSpell(spell_id);
4276 if (spellSkillRange.empty())
4282 for (
const auto& [_, skillEntry] : spellSkillRange)
4285 if (skillEntry->race_mask > 0 && !(skillEntry->race_mask & raceMask))
4289 if (skillEntry->class_mask > 0 && !(skillEntry->class_mask & classMask))
4308 if (curTime < itr->second.ExpireTime)
4320 if (curTime < itr->second.ExpireTime)
4350 const auto spellId = spellInfo->
getId();
4354 if (spellCategoryCooldown > 0 && spellInfo->
getCategory() > 0)
4357 if (castingSpell !=
nullptr)
4365 if (spellCooldown > 0)
4368 if (castingSpell !=
nullptr)
4375 sendSpellCooldownPacket(spellInfo, spellCooldown > spellCategoryCooldown ? spellCooldown : spellCategoryCooldown,
false);
4396 gcdDuration = std::max(gcdDuration, 1000);
4397 gcdDuration = std::min(gcdDuration, 1500);
4400 if (gcdDuration <= 0)
4411 std::vector<SmsgSpellCooldownMap> spellMap;
4417 spellMap.push_back(mapMembers);
4424 const auto spellInfo =
sSpellMgr.getSpellInfo(spellId);
4425 if (spellInfo ==
nullptr)
4435 auto cooldown = (*itr);
4468 auto spellId = (*itr).second.SpellId;
4498 if (cooldownTime > 0)
4504 PlayerCooldownMap::iterator cooldownMapItr;
4513 if (mstime < cooldownMapItr->second.ExpireTime)
4523 if (mstime < cooldownMapItr->second.ExpireTime)
4541 if (itemProperties->Spells[spellIndex].Id != 0 && itemProperties->Spells[spellIndex].Trigger ==
USE)
4543 if (
const auto*
const spellInfo =
sSpellMgr.getSpellInfo(itemProperties->Spells[spellIndex].Id))
4561 for (
uint8_t effectIndex = 0; effectIndex < 3; ++effectIndex)
4580 auto& playerCooldown = cooldownItr->second;
4581 if (playerCooldown.ExpireTime < time)
4583 playerCooldown.ExpireTime = time;
4584 playerCooldown.ItemId = ItemId;
4585 playerCooldown.SpellId = SpellId;
4592 playerCooldown.
ItemId = ItemId;
4593 playerCooldown.
SpellId = SpellId;
4598 sLogger.debug(
"Player::_addCategoryCooldown added cooldown for COOLDOWN_TYPE_CATEGORY category_type {} time {} item {} spell {}", categoryId, time -
Util::getMSTime(), ItemId, SpellId);
4603 PlayerCooldownMap::iterator cooldownItr =
m_cooldownMap[type].find(mis);
4606 auto& playerCooldown = cooldownItr->second;
4607 if (playerCooldown.ExpireTime < time)
4609 playerCooldown.ExpireTime = time;
4610 playerCooldown.ItemId = ItemId;
4611 playerCooldown.SpellId = SpellId;
4618 playerCooldown.
ItemId = ItemId;
4619 playerCooldown.
SpellId = SpellId;
4621 m_cooldownMap[type].insert(std::make_pair(mis, playerCooldown));
4624 sLogger.debug(
"Player::_addCooldown added cooldown for type {} misc {} time {} item {} spell {}", type, mis, time -
Util::getMSTime(), ItemId, SpellId);
4629 if (result ==
nullptr)
4653 uint32_t realtime = mstime + ((rtime) * 1000);
4658 playerCooldown.
ItemId = itemid;
4659 playerCooldown.
SpellId = spellid;
4660 m_cooldownMap[type].insert(std::make_pair(misc, playerCooldown));
4670 buf->AddQuery(
"DELETE FROM playercooldowns WHERE player_guid = %u",
getGuidLow());
4678 PlayerCooldownMap::iterator nextCooldownItr = cooldownItr++;
4680 if (mstime >= nextCooldownItr->second.ExpireTime)
4689 uint32_t seconds = (nextCooldownItr->second.ExpireTime - mstime) / 1000;
4693 buf->AddQuery(
"INSERT INTO playercooldowns VALUES(%u, %u, %u, %u, %u, %u)",
getGuidLow(),
4694 index, nextCooldownItr->first, seconds + (
uint32_t)
UNIXTIME, nextCooldownItr->second.SpellId, nextCooldownItr->second.ItemId);
4699 index, nextCooldownItr->first, seconds + (
uint32_t)
UNIXTIME, nextCooldownItr->second.SpellId, nextCooldownItr->second.ItemId);
4718 auto itr =
m_skills.find(skillLine);
4719 if (itr ==
m_skills.end() || itr->second.CurrentValue == 0)
4729 const auto currentValue = itr->second.CurrentValue;
4731 const uint16_t newValue = currentValue + amount;
4732 itr->second.CurrentValue = std::min(newValue, itr->second.MaximumValue);
4735 if (itr->second.CurrentValue == currentValue)
4740 skillStep = itr->second.MaximumValue / 75U;
4743#if VERSION_STRING >= Cata
4750 sHookInterface.OnAdvanceSkillLine(
this, skillLine, itr->second.CurrentValue);
4752#ifdef FT_ACHIEVEMENTS
4753 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL, skillLine, skillStep);
4754 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, skillLine, itr->second.CurrentValue);
4766 if (skillEntry ==
nullptr)
4773 if (!initializeProfession)
4774 currentValue = currentValue < 1 ? 1U : currentValue;
4776 const auto onLearnedNewSkill = [&](
uint16_t curVal,
uint16_t skillStep,
bool isPrimaryProfession) ->
void
4778#if VERSION_STRING >= Cata
4780 if (isPrimaryProfession)
4789 if (isPrimaryProfession)
4795 if (aura ==
nullptr)
4800 const auto aurEff = aura->getAuraEffect(i);
4806#if VERSION_STRING >= TBC
4812 const auto effType = aurEff->getAuraEffectType();
4813 if (aurEff->getEffectMiscValue() == skillLine)
4814 aura->applyModifiers(
true, effType);
4818 if (!noSpellLearning)
4821#ifdef FT_ACHIEVEMENTS
4822 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL, skillLine, skillStep, 0);
4823 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, skillLine, currentValue, 0);
4827 auto itr =
m_skills.find(skillLine);
4832 if (!((currentValue > itr->second.CurrentValue && maxValue >= itr->second.MaximumValue) || (currentValue == itr->second.CurrentValue && maxValue > itr->second.MaximumValue)))
4835 itr->second.CurrentValue = currentValue;
4836 itr->second.MaximumValue = maxValue;
4841 if (itr->second.CurrentValue > 0)
4842 onLearnedNewSkill(itr->second.CurrentValue, skillStep, itr->second.Skill->type ==
SKILL_TYPE_PROFESSION);
4847 auto foundPosition =
false;
4851#if VERSION_STRING >= Cata
4857 fieldPosition.
offset = offset;
4858 foundPosition =
true;
4864 fieldPosition.index = i;
4865 foundPosition =
true;
4873 sLogger.failure(
"Player::addSkillLine : Could not add skill line {} to player (guid {}), skill fields are full!", skillLine,
getGuidLow());
4878 newSkill.
Skill = skillEntry;
4883 if (!initializeProfession)
4886 m_skills.insert(std::make_pair(skillLine, newSkill));
4889#if VERSION_STRING < Cata
4917 const auto itr =
m_skills.find(skillLine);
4922 if (itr->second.CurrentValue == 0 && !strict)
4933 const auto itr =
m_skills.find(skillLine);
4938 return itr->second.CurrentValue;
4940 const auto result =
static_cast<int32_t>(itr->second.CurrentValue) + itr->second.PermanentBonusValue + itr->second.TemporaryBonusValue;
4941 return result < 0 ? 0U : static_cast<uint16_t>(result);
4949 const auto itr =
m_skills.find(skillLine);
4953 return itr->second.MaximumValue;
4960 if (skill.skillid == 0)
4964 if (skillLine ==
nullptr)
4968 auto curVal = skill.currentval;
4981 const auto skillRange =
sSpellMgr.getSkillEntryRangeForSkill(skillLine);
4982 for (
const auto& [_, skillEntry] : skillRange)
4984 if (skillEntry->acquireMethod != 1 && skillEntry->acquireMethod != 2)
4988 if (skillEntry->race_mask != 0 && !(skillEntry->race_mask & raceMask))
4992 if (skillEntry->class_mask != 0 && !(skillEntry->class_mask & classMask))
4996 if (currentValue < skillEntry->minSkillLineRank)
5000 addSpell(skillEntry->spell, skillLine);
5009 auto itr =
m_skills.find(skillLine);
5010 if (itr ==
m_skills.end() || itr->second.CurrentValue == 0)
5014 itr->second.PermanentBonusValue += amount;
5016 itr->second.TemporaryBonusValue += amount;
5027 auto itr =
m_skills.find(skillLine);
5031 const auto oldCurValue = itr->second.CurrentValue;
5032 const auto oldMaxValue = itr->second.MaximumValue;
5033 itr->second.MaximumValue = maxValue;
5035 auto valuesChanged =
false;
5038 _verifySkillValues(itr->second.Skill, &itr->second.CurrentValue, &itr->second.MaximumValue, &skillStep, &valuesChanged);
5040 if (oldMaxValue != itr->second.MaximumValue || valuesChanged)
5043#if VERSION_STRING >= Cata
5050#ifdef FT_ACHIEVEMENTS
5051 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SKILL_LEVEL, skillLine, skillStep, 0);
5055 if (oldCurValue == itr->second.CurrentValue)
5058 sHookInterface.OnAdvanceSkillLine(
this, skillLine, itr->second.CurrentValue);
5060#ifdef FT_ACHIEVEMENTS
5061 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_REACH_SKILL_LEVEL, skillLine, itr->second.CurrentValue, 0);
5073 auto itr =
m_skills.find(skillLine);
5077 const auto fieldPosition = itr->second.FieldPosition;
5082#if VERSION_STRING >= Cata
5092 itr->second.MaximumValue = 75;
5093 itr->second.CurrentValue = 0;
5094 itr->second.TemporaryBonusValue = 0;
5095 itr->second.PermanentBonusValue = 0;
5104#if VERSION_STRING < Cata
5124 if (aurEff->getEffectMiscValue() == skillLine)
5126 auto modifiableAurEff = aurEff->getAura()->getModifiableAuraEffect(aurEff->getEffectIndex());
5127 modifiableAurEff->setEffectActive(
false);
5134 if (aurEff->getEffectMiscValue() == skillLine)
5136 auto modifiableAurEff = aurEff->getAura()->getModifiableAuraEffect(aurEff->getEffectIndex());
5137 modifiableAurEff->setEffectActive(
false);
5147 const auto skillRange =
sSpellMgr.getSkillEntryRangeForSkill(skillLine);
5148 for (
const auto& [_, skillEntry] : skillRange)
5160 const auto itr2 = itr;
5173 if (itr.second.CurrentValue == 0)
5176 auto valuesChanged =
false;
5179 _verifySkillValues(itr.second.Skill, &itr.second.CurrentValue, &itr.second.MaximumValue, &skillStep, &valuesChanged);
5182#if VERSION_STRING < Cata
5193 SkillMap::iterator itr =
m_skills.find(
id);
5197 return itr->second.GetSkillUpChance();
5200#if VERSION_STRING >= Cata
5204#if VERSION_STRING == Cata
5206#elif VERSION_STRING == Mop
5211 if (skillLine ==
nullptr)
5255 if (spellInfo ==
nullptr)
5259 const auto skill_line_ability =
sSpellMgr.getFirstSkillEntryForSpell(spellInfo->
getId());
5260 if (skill_line_ability !=
nullptr)
5261 skillId =
static_cast<uint16_t>(skill_line_ability->skilline);
5264 if (skill_line ==
nullptr)
5305void Player::updateGlyphs()
5307#if VERSION_STRING == WotLK
5311 if (glyphSlot ==
nullptr)
5314 if (glyphSlot->Slot > 0)
5322 if (glyphSlot !=
nullptr)
5330#if VERSION_STRING == WotLK
5341#elif VERSION_STRING == Cata
5348#elif VERSION_STRING == Mop
5396 unsigned char buffer[10];
5433 const auto* spellInfo =
sSpellMgr.getSpellInfo(spellId);
5434 if (spellInfo ==
nullptr)
5444 if (spellInfo->hasSpellRanks())
5446 if (!learningPreviousRanks)
5449 const auto* higherRankInfo = spellInfo->getRankInfo()->getLastSpell();
5450 const auto isSingleRankAbility = spellInfo->canKnowOnlySingleRank();
5455 if (isSingleRankAbility &&
hasSpell(higherRankInfo->getId()))
5464 if (higherRankInfo->getId() == spellId)
5467 higherRankInfo = higherRankInfo->getRankInfo()->getPreviousSpell();
5468 }
while (higherRankInfo !=
nullptr);
5470 if (higherRankInfo !=
nullptr)
5471 spellInfo = higherRankInfo;
5479 if (!ignorePreviousRanks && !spellInfo->isTalent() && !spellInfo->canKnowOnlySingleRank())
5482 if (
const auto*
const previousSpell = spellInfo->getRankInfo()->getPreviousSpell())
5483 _addSpell(previousSpell->getId(), fromSkill,
true);
5493 if (spellInfo->hasSpellRanks() && (spellInfo->canKnowOnlySingleRank() || spellInfo->isTalent()))
5496 const auto* previousRank = spellInfo->getRankInfo()->getPreviousSpell();
5497 const auto moveToDeleted = !spellInfo->isTalent();
5498 const auto silently = !spellInfo->isTalent();
5499 while (previousRank !=
nullptr)
5501 if (
_removeSpell(previousRank->getId(), moveToDeleted, silently,
true))
5503 if (!spellInfo->isTalent())
5504 supercededSpellId = previousRank->getId();
5508 previousRank = previousRank->getRankInfo()->getPreviousSpell();
5516 if (!ignorePreviousRanks)
5519 if (supercededSpellId > 0)
5531 else if (spellInfo->isPassive())
5533 if (spellInfo->getRequiredShapeShift() == 0 ||
5551 const auto spellSkillRange =
sSpellMgr.getSkillEntryRangeForSpell(spellId);
5552 for (
const auto& [_, skillEntry] : spellSkillRange)
5554 if (skillEntry->race_mask > 0 && !(skillEntry->race_mask & raceMask))
5557 if (skillEntry->class_mask > 0 && !(skillEntry->class_mask & classMask))
5560 const auto skillLine =
static_cast<uint16_t>(skillEntry->skilline);
5571#ifdef FT_ACHIEVEMENTS
5575 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LEARN_SPELL, spellId, 1, 0);
5579 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_MOUNTS, 777, 0, 0);
5587 if (summonProperties->Slot == 5 || (summonProperties->Type ==
SUMMON_TYPE_COMPANION && summonProperties->Slot != 6))
5588 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_NUMBER_OF_MOUNTS, 778, 0, 0);
5596 const auto itr = std::as_const(
m_spellSet).find(spellId);
5601 if (forceRemoveHigherRanks)
5603 const auto*
const spellInfo =
sSpellMgr.getSpellInfo(spellId);
5604 if (spellInfo ==
nullptr || !spellInfo->hasSpellRanks() || !spellInfo->canKnowOnlySingleRank())
5607 const auto* higherRankInfo = spellInfo->getRankInfo()->getNextSpell();
5608 while (higherRankInfo !=
nullptr)
5610 if (
_removeSpell(higherRankInfo->getId(),
true, silently,
true))
5616 higherRankInfo = higherRankInfo->getRankInfo()->getNextSpell();
5629 const auto*
const spellInfo =
sSpellMgr.getSpellInfo(spellId);
5630 auto activatedPreviousRank =
false;
5631 if (spellInfo->hasSpellRanks())
5634 if (!removingPreviousRank && spellInfo->canKnowOnlySingleRank())
5636 const auto* previousSpell = spellInfo->getRankInfo()->getPreviousSpell();
5637 while (previousSpell !=
nullptr)
5641 _addSpell(previousSpell->getId(), 0,
true,
true);
5642 activatedPreviousRank =
true;
5645 previousSpell = previousSpell->getRankInfo()->getPreviousSpell();
5648 if (
IsInWorld() && !silently && activatedPreviousRank)
5655 const auto spellEff = spellInfo->getEffect(i);
5663 if (
const auto taughtSpellId = spellInfo->getEffectTriggerSpell(i))
5673 if (
const auto triggerSpellId = spellInfo->getEffectTriggerSpell(i))
5676#if VERSION_STRING >= WotLK
5686 if (
IsInWorld() && !silently && !activatedPreviousRank)
5689 if (spellInfo->hasSpellRanks())
5692 if (
const auto*
const nextSpell = spellInfo->getRankInfo()->getNextSpell())
5703#if VERSION_STRING <= WotLK
5706#if VERSION_STRING <= TBC
5707 level_bound_skill = level_bound_skill || skillEntry->
id ==
SKILL_POISONS;
5711 auto isCurrentValueMaxed =
false;
5712 *requireUpdate =
false;
5714 if (level_bound_skill)
5717#if VERSION_STRING >= Cata
5719 isCurrentValueMaxed =
true;
5725 isCurrentValueMaxed =
true;
5729 newMaximum = *maxValue;
5731 if (newMaximum == 0)
5741 isCurrentValueMaxed =
true;
5746 isCurrentValueMaxed =
true;
5753 if (*maxValue != newMaximum)
5755 *requireUpdate =
true;
5756 *maxValue = newMaximum;
5758 if (*currentValue > newMaximum)
5760 *requireUpdate =
true;
5761 *currentValue = newMaximum;
5765 if (isCurrentValueMaxed && *currentValue != newMaximum)
5767 *requireUpdate =
true;
5768 *currentValue = newMaximum;
5772 *skillStep = *maxValue / 75U;
5779 auto requireUpdate =
false;
5785#if VERSION_STRING < Cata
5802#if VERSION_STRING < Cata
5818 if (curTalentPoints == 0)
5825 if (talentInfo ==
nullptr)
5827#if VERSION_STRING < Mop
5828 if (
sSpellMgr.isSpellDisabled(talentInfo->RankID[talentRank]))
5836 for (
auto i = talentRank; i <= 4; ++i)
5838 if (talentInfo->RankID[i] != 0 &&
hasSpell(talentInfo->RankID[i]))
5843 auto talentTreeInfo =
sTalentTabStore.lookupEntry(talentInfo->TalentTree);
5844 if (talentTreeInfo ==
nullptr || !(
getClassMask() & talentTreeInfo->ClassMask))
5847#if VERSION_STRING >= Cata
5851 auto pointsUsed = 0;
5854 pointsUsed += rank + 1;
5858 if (pointsUsed < 31)
5864 if (talentInfo->DependsOn > 0)
5866 auto dependsOnTalent =
sTalentStore.lookupEntry(talentInfo->DependsOn);
5867 if (dependsOnTalent !=
nullptr)
5869 auto hasEnoughRank =
false;
5870 for (
auto i = 0; i <= 4; ++i)
5872 if (dependsOnTalent->RankID[i] != 0)
5874 if (
hasSpell(dependsOnTalent->RankID[i]))
5876 hasEnoughRank =
true;
5886 auto spellId = talentInfo->RankID[talentRank];
5889 sLogger.info(
"Player::learnTalent: Player tried to learn talent {} (rank {}) but talent's spell id is 0.", talentId, talentRank);
5895 if (talentInfo->Row > 0)
5901 if (tmpTalent ==
nullptr)
5904 if (tmpTalent->TalentTree != talentInfo->TalentTree)
5906 spentPoints += rank + 1;
5910 if (spentPoints < (talentInfo->Row * 5))
5915 auto isMultiRankTalent =
false;
5916 for (
int8_t _talentRank = 4; _talentRank >= 0; --_talentRank)
5918 if (talentInfo->RankID[_talentRank] != 0)
5920 if (_talentRank > 0)
5921 isMultiRankTalent =
true;
5923 if (
hasSpell(talentInfo->RankID[_talentRank]))
5925 curTalentRank = _talentRank + 1;
5932 auto requiredTalentPoints = (talentRank + 1) - curTalentRank;
5933 if (curTalentPoints < requiredTalentPoints)
5937 if (curTalentRank >= (talentRank + 1))
5944 const auto spellInfo =
sSpellMgr.getSpellInfo(spellId);
5945 if (spellInfo ==
nullptr)
5948 _addSpell(spellId, 0, isMultiRankTalent);
5950#if VERSION_STRING >= Cata
5968#if VERSION_STRING < Mop
5972 if (
const auto* tmpTalent =
sTalentStore.lookupEntry(talentId))
5973 _removeSpell(tmpTalent->RankID[rank],
false,
false,
true,
true);
5987#if VERSION_STRING >= Cata
6031#if VERSION_STRING < Cata
6033 setFreeTalentPoints(talentPoints);
6049#if VERSION_STRING < Cata
6066#if VERSION_STRING >= Cata
6068 if (talentPointsAtLevel !=
nullptr)
6069 talentPoints =
static_cast<uint32_t>(talentPointsAtLevel->talentPoints);
6074#ifdef FT_DEATH_KNIGHT
6084#if VERSION_STRING >= Cata
6086 if (dkBaseTalentPoints !=
nullptr)
6087 dkTalentPoints =
getLevel() < 55 ? 0 : talentPoints -
static_cast<uint32_t>(dkBaseTalentPoints->talentPoints);
6094 if (dkTalentPoints < talentPoints)
6095 talentPoints = dkTalentPoints;
6099 talentPoints +=
worldConfig.player.deathKnightStartTalentPoints;
6105 if (!talentsResetted)
6111 if (m_specs[inactiveSpec].getTalents().size() > 0)
6114 for (
const auto& [talentId, rank] : m_specs[inactiveSpec].getTalents())
6116 usedTalentPoints2 += rank + 1;
6119 if (usedTalentPoints2 > talentPoints)
6120 usedTalentPoints2 = talentPoints;
6122 m_specs[inactiveSpec].setTalentPoints(talentPoints - usedTalentPoints2);
6130 usedTalentPoints += rank + 1;
6133 if (usedTalentPoints > talentPoints)
6134 usedTalentPoints = talentPoints;
6155#if VERSION_STRING < Mop
6156#if VERSION_STRING >= WotLK
6158 data <<
uint8_t(SendPetTalents ? 1 : 0);
6179#if VERSION_STRING >= Cata
6186 for (
const auto& [talentId, rank] : spec.
getTalents())
6220 for (
uint8_t i = 0; i < 6; ++i)
6224 for (
const auto& [talentId, rank] : spec.
getTalents())
6229 data.
PutBits(wpos[specId], talentCount, 23);
6239#if VERSION_STRING < Mop
6259 if (glyphProperties !=
nullptr)
6266 const auto talentInfo =
sTalentStore.lookupEntry(talentId);
6267 if (talentInfo !=
nullptr)
6268 _removeSpell(talentInfo->RankID[rank],
true,
false,
true,
true);
6277 if (glyphProperties !=
nullptr)
6278 castSpell(
this, glyphProperties->SpellID,
true);
6284 const auto talentInfo =
sTalentStore.lookupEntry(talentId);
6285 if (talentInfo ==
nullptr)
6287 auto isSingleRankTalent = rank == 0;
6288 if (isSingleRankTalent)
6290 for (
uint8_t talentRank = 1; talentRank < 5; ++talentRank)
6292 if (talentInfo->RankID[talentRank] != 0)
6294 isSingleRankTalent =
false;
6299 _addSpell(talentInfo->RankID[rank], 0, !isSingleRankTalent);
6329 return resetnum * 50000;
6354 auto*
const fields = result->Fetch();
6355 for (
uint8_t id = 0;
id < 8; ++id)
6366 CharacterDatabase.Execute(
"INSERT INTO tutorials VALUES('%u','%u','%u','%u','%u','%u','%u','%u','%u');",
getGuidLow(),
m_tutorials[0],
m_tutorials[1],
m_tutorials[2],
m_tutorials[3],
m_tutorials[4],
m_tutorials[5],
m_tutorials[6],
m_tutorials[7]);
6386#if VERSION_STRING < Mop
6389#if VERSION_STRING == WotLK
6402#if VERSION_STRING < WotLK
6467#if VERSION_STRING >= Cata
6478 const auto auctionId = auction ? auction->
Id : 0;
6480#if VERSION_STRING >= Cata
6522 if (
auto* tradeTarget =
m_TradeData->getTradeTarget())
6524 std::scoped_lock<std::mutex> targetGuard(tradeTarget->m_tradeMutex);
6528 tradeTarget->m_TradeData =
nullptr;
6541 gm_ann +=
"|HPlayer:";
6542 gm_ann += playerName;
6544 gm_ann += playerName;
6547 gm_ann += damageLog;
6549 sWorld.sendMessageToOnlineGms(gm_ann);
6555 va_start(list, Format);
6557 vsnprintf(
Message, 1024, Format, list);
6566 va_start(list, message);
6568 vsnprintf(msg, 500, message, list);
6579 if (offHandWeapon ==
nullptr)
6582 auto needToRemove =
true;
6592 if (mainHandWeapon !=
nullptr && mainHandWeapon->getItemProperties()->InventoryType ==
INVTYPE_2HWEAPON)
6597 if (offHandWeapon->isWeapon())
6600 needToRemove =
false;
6613 offHandWeapon->removeFromWorld();
6614 offHandWeapon->setOwner(
nullptr);
6620 auto [addResult, returnedItem] =
getItemInterface()->
SafeAddItem(std::move(offHandWeaponHolder), result.ContainerSlot, result.Slot);
6635 if (offHandItem ==
nullptr)
6646#if VERSION_STRING == WotLK
6652 if (!ssd || !ssvrow)
6655 std::map<uint32_t, int32_t> tempStats;
6665 if (ssd->
stat[
id] < 0)
6667 statType = ssd->
stat[id];
6670 tempStats[statType] = val;
6675 for (
auto generalStats : proto->generalStatsMap)
6679 if (tempStats.find(generalStats.first) == tempStats.end())
6680 tempStats[generalStats.first] = generalStats.second;
6685 auto it = tempStats.begin();
6874 float average = extraDPS * proto->
Delay / 1000.0f;
6875 minDamage = 0.7f * average;
6876 maxDamage = 1.3f * average;
6903#if VERSION_STRING > WotLK
6910#if VERSION_STRING > TBC
6945 item->removeAllEnchantments(
true);
6951 if (item->isContainer())
6956 if (
auto*
const bagItem = bag->
getItem(
static_cast<int16_t>(ci)))
6965 item->removeAllEnchantments(
true);
6981 if (!itemProperties)
6990 if (itemProperties->
ItemSet < 0)
6997 setId = itemProperties->
ItemSet;
7005 [setId](
ItemSet const& itemset) { return itemset.setid == setId; });
7015 auto& newItemSet =
m_itemSets.emplace_back(setId, 1);
7016 itemSet = &newItemSet;
7020 itemSet = &(*itemSetListMember);
7025 if (!itemSetEntry->RequiredSkillID || (
getSkillLineCurrent(
static_cast<uint16_t>(itemSetEntry->RequiredSkillID),
true) >= itemSetEntry->RequiredSkillAmt))
7027 for (
uint8_t itemIndex = 0; itemIndex < 8; ++itemIndex)
7029 if (itemSet->
itemscount == itemSetEntry->itemscount[itemIndex])
7031 const auto spellInfo =
sSpellMgr.getSpellInfo(itemSetEntry->SpellID[itemIndex]);
7032 Spell* spell =
sSpellMgr.newSpell(
this, spellInfo,
true,
nullptr);
7043 auto* itemSet = &(*itemSetListMember);
7044 for (
uint8_t itemIndex = 0; itemIndex < 8; ++itemIndex)
7045 if (itemSet->itemscount == itemSetEntry->itemscount[itemIndex])
7048 if (!(--itemSet->itemscount))
7055 sLogger.failure(
"Item {} has wrong ItemSet {}", itemProperties->
ItemId, setId);
7062 switch (resistanceStat.first)
7094#if VERSION_STRING > TBC
7097 calculateHeirloomBonus(itemProperties, slot, apply);
7106 if (itemProperties->
Armor)
7151 if (itemSpell.Id == 0)
7154 if (
auto spellInfo =
sSpellMgr.getSpellInfo(itemSpell.Id))
7158 if (spellInfo->getRequiredShapeShift())
7164 Spell* spell =
sSpellMgr.newSpell(
this, spellInfo,
true,
nullptr);
7205 if (
auto spellInfo =
sSpellMgr.getSpellInfo(itemSpell.Id))
7207 if (spellInfo->getRequiredShapeShift())
7225 if (m_aura->m_castedItemId && m_aura->m_castedItemId == itemProperties->
ItemId)
7226 m_aura->removeAura();
7267#if VERSION_STRING > TBC
7268 if (unitAttacker !=
nullptr)
7270 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATH, 1, 0, 0);
7271 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_DEATH_AT_MAP,
GetMapId(), 1, 0);
7274 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_PLAYER, 1, 0, 0);
7276 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILLED_BY_CREATURE, 1, 0, 0);
7280 if (unitAttacker !=
nullptr && !
sHookInterface.OnPreUnitDie(unitAttacker,
this))
7283 if (unitAttacker !=
nullptr && !unitAttacker->
isPlayer())
7293 for (
uint8_t i = 0; i < 3; i++)
7306 if (spell->getSpellInfo()->getChannelInterruptFlags() == 48140)
7313 Unit* attacker =
dynamic_cast<Unit*
>(inRangePlayer);
7354 selfResSpellId = 21169;
7362 if (unitAttacker !=
nullptr)
7365 static_cast<Creature*
>(unitAttacker)->GetScript()->OnTargetDied(
this);
7393 if (sorInfo !=
nullptr)
7405#if VERSION_STRING == WotLK
7455 const auto corpse =
sObjectMgr.createCorpse();
7480 corpse->generateLoot();
7482 corpse->setDynamicFlags(1);
7490 corpse->loot.gold = 0;
7497 const uint32_t displayId = item->getItemProperties()->DisplayInfoID;
7498 const auto inventoryType =
static_cast<uint16_t>(item->getItemProperties()->InventoryType);
7500 const uint32_t itemId =
static_cast<uint16_t>(displayId) | inventoryType << 24;
7501 corpse->setItem(slot, itemId);
7510 if (
const auto corpse =
sObjectMgr.getCorpseByOwner(this->getGuidLow()))
7512 if (!corpse->IsInWorld())
7515 corpse->setDynamicFlags(1);
7518 corpse->AddToWorld();
7523 setCorpseData(corpse->GetPosition(), corpse->GetInstanceID());
7539 corpse->spawnBones();
7553 corpse->resetDeathClock();
7562 transport->RemovePassenger(
this);
7585 if (mapInfo->isWorldMap() || mapInfo->isBattlegroundOrArena())
7588 repopAtGraveyard(mapInfo->repopx, mapInfo->repopy, mapInfo->repopz, mapInfo->repopmapid);
7590 switch (mapInfo->mapid)
7615 corpse->resetDeathClock();
7624#if VERSION_STRING >= WotLK
7637 float closestDistance = 999999.0f;
7640 for (
const auto& graveyardStore : *
sMySQLStore.getGraveyardsStore())
7642 graveyard =
sMySQLStore.getGraveyard(graveyardStore.second.id);
7647 if (first || distance < closestDistance)
7650 closestDistance = distance;
7651 finalDestination = temp;
7656 if (first && graveyard)
7690 uint32_t AuraIds[] = { 20584, 9036, 8326, 55164, 0 };
7704 for (
uint8_t i = 0; i < 7; ++i)
7713#if VERSION_STRING > TBC
7717 uint32_t AuraIds[] = { 20584, 9036, 8326, 0 };
7727 Spell* spell =
sSpellMgr.newSpell(
this, spellInfo,
true,
nullptr);
7733 Spell* spell =
sSpellMgr.newSpell(
this, spellInfo,
true,
nullptr);
7755 const uint32_t maxDurability = item->getMaxDurability();
7756 const uint32_t durability = item->getDurability();
7759 int32_t newDurability =
static_cast<uint32_t>(maxDurability * percent);
7760 newDurability = durability - newDurability;
7761 if (newDurability < 0)
7764 if (newDurability <= 0)
7767 item->setDurability(
static_cast<uint32_t>(newDurability));
7768 item->m_isDirty =
true;
7840 if (charter ==
nullptr || requester ==
nullptr)
7872 Field* fields = result->Fetch();
7939 group->UpdateOutOfRangePlayer(
this,
true,
nullptr);
7944 pet->resetAuraUpdateMaskForRaid();
7962 if (channel ==
nullptr)
7971 if (channel ==
nullptr)
7982#if VERSION_STRING < WotLK
7996 if (channelDbc ==
nullptr)
7999 Channel* oldChannel =
nullptr;
8004 if (_channel->getChannelId() == i)
8007 oldChannel = _channel;
8013 if (
sChannelMgr.canPlayerJoinDefaultChannel(
this, areaEntry, channelDbc))
8015 auto channelName =
sChannelMgr.generateChannelName(channelDbc, areaEntry);
8017 auto newChannel =
sChannelMgr.getOrCreateChannel(channelName,
this, channelDbc->id);
8018 if (newChannel ==
nullptr)
8021 sLogger.failure(
"Player::updateChannels : Could not create new channel {} with name {}", channelDbc->id, channelName);
8025 if (newChannel != oldChannel && !newChannel->
hasMember(
this))
8030 if (oldChannel !=
nullptr)
8037 if (oldChannel !=
nullptr)
8045 std::set<Channel*> removeList;
8049 removeList.insert(channel);
8053 auto itr = removeList.begin();
8054 while (itr != removeList.end())
8056 (*itr)->leaveChannel(
this);
8057 itr = removeList.erase(itr);
8080#if VERSION_STRING != Classic
8084 setArenaTeamMemberRank(i, 0);
8086 setArenaTeamMemberRank(i, 1);
8107 newPoints -= arenaPoints;
8119#if VERSION_STRING > Classic
8120#if VERSION_STRING < Cata
8152 newPoints -= honorPoints;
8164#if VERSION_STRING != Classic
8166#if VERSION_STRING < Cata
8222 const auto areaTableEntry = this->
GetArea();
8224 if (areaTableEntry !=
nullptr &&
isAlive() &&
8233 auto areaTableEntry = this->
GetArea();
8234 if (areaTableEntry ==
nullptr)
8267 if (areaTableEntry->zone)
8352#if VERSION_STRING >= WotLK
8363 auto areaTableEntry = this->
GetArea();
8380#if VERSION_STRING >= WotLK
8387#if VERSION_STRING >= WotLK
8411#if VERSION_STRING >= WotLK
8426#if VERSION_STRING >= WotLK
8434#if VERSION_STRING >= WotLK
8456#if VERSION_STRING >= WotLK
8471#if VERSION_STRING >= WotLK
8479#if VERSION_STRING >= WotLK
8494#if VERSION_STRING >= WotLK
8501#if VERSION_STRING >= WotLK
8517#if VERSION_STRING > Classic
8518 const auto index =
static_cast<uint8_t>(title / 32);
8520 return (getKnownTitles(index) & 1ULL <<
static_cast<uint64_t>((title % 32))) != 0;
8528#if VERSION_STRING > Classic
8532 const auto index =
static_cast<uint8_t>(title / 32);
8533 const uint64_t current = getKnownTitles(index);
8536 setKnownTitles(index, current | 1ULL <<
static_cast<uint64_t>((title % 32)));
8538 setKnownTitles(index, current & ~1 << (title % 32));
8587 if (wonBattleground)
8591 honorPoints =
worldConfig.bg.honorableKillsRbg * honorForSingleKill;
8592 arenaPoints =
worldConfig.bg.honorableArenaWinRbg;
8596 honorPoints =
worldConfig.bg.firstRbgHonorValueToday * honorForSingleKill;
8597 arenaPoints =
worldConfig.bg.firstRbgArenaHonorValueToday;
8602 honorPoints =
worldConfig.bg.honorByLosingRbg * honorForSingleKill;
8603 arenaPoints =
worldConfig.bg.honorByLosingArenaRbg;
8611 this->
addHonor(honorPoints,
false);
8644 bool bValid =
false;
8645 bool hasquest =
true;
8646 bool bSkipLevelCheck =
false;
8650 Object* qst_giver =
nullptr;
8659 qst_giver = quest_giver;
8663 hasquest = quest_giver->
HasQuest(quest_id, 1);
8667 questProperties =
sMySQLStore.getQuestProperties(quest_id);
8674 qst_giver = quest_giver;
8679 questProperties =
sMySQLStore.getQuestProperties(quest_id);
8681 else if (wowGuid.
isItem())
8685 qst_giver = quest_giver;
8690 bSkipLevelCheck =
true;
8691 questProperties =
sMySQLStore.getQuestProperties(quest_id);
8697 qst_giver = quest_giver;
8702 questProperties =
sMySQLStore.getQuestProperties(quest_id);
8707 sLogger.debug(
"WORLD: Invalid questgiver GUID.");
8711 if (!bValid || questProperties ==
nullptr)
8713 sLogger.debug(
"WORLD: Creature is not a questgiver.");
8727 const uint32_t status =
sQuestMgr.CalcQuestStatus(qst_giver,
this, questProperties, 3, bSkipLevelCheck);
8762 questLogEntry->updatePlayerFields();
8769 if (
auto itemHolder =
sObjectMgr.createItem(receive_item,
this))
8771 auto* item = itemHolder.get();
8777 1, item->getEntry(), item->getPropertySeed(), item->getRandomPropertiesId(), item->getStackCount());
8798 if (saBounds.first != saBounds.second)
8800 for (
auto itr = saBounds.first; itr != saBounds.second; ++itr)
8802 if (itr->second->autoCast && itr->second->fitsToRequirements(
this,
getZoneId(),
getAreaId()))
8804 castSpell(
this, itr->second->spellId,
true);
8808 sQuestMgr.OnQuestAccepted(
this, questProperties, qst_giver);
8814 sLogger.debug(
"WORLD: Added new QLE.");
8823 if (questProperties ==
nullptr)
8829 m_questlog[slotId] = std::make_unique<QuestLogEntry>(questProperties,
this, slotId);
8836 if (questlogSlot !=
nullptr)
8862 if (questlogSlot !=
nullptr)
8863 if (questlogSlot->getQuestProperties()->id == questId)
8864 return questlogSlot.get();
8901 if (questlogSlot !=
nullptr && questlogSlot->getQuestProperties()->time != 0)
8913 sQuestMgr.SendQuestUpdateFailedTimer(qst,
this);
8915 if (
const auto questScript = questLogEntry->getQuestScript())
8916 questScript->OnQuestCancel(
this);
8918 questLogEntry->sendQuestFailed(
true);
8955 if (questLogEntry !=
nullptr)
8957 QuestProperties const* questProperties = questLogEntry->getQuestProperties();
8960 if (
const auto* tempList =
sQuestMgr.GetQuestAssociationListForItemId(itemId))
8962 for (
auto questAssiciation = tempList->cbegin(); questAssiciation != tempList->cend(); ++questAssiciation)
8963 if ((*questAssiciation)->qst == questProperties && (
getItemInterface()->GetItemCount(itemId) < (*questAssiciation)->item_count))
9028 if (
QuestProperties const* quest = questLogEntry->getQuestProperties())
9030 if (questLogEntry->getMobCountByIndex(reqId) >= quest->required_mob_or_go_count[reqId])
9033 questLogEntry->incrementMobCountForIndex(reqId);
9034 questLogEntry->sendUpdateAddKill(reqId);
9035 questLogEntry->updatePlayerFields();
9037 if (questLogEntry->canBeFinished())
9038 questLogEntry->sendQuestComplete();
9048 if (obj ==
nullptr || !obj->isGameObject() || obj->isTransporter())
9051 if (
const auto gameobject =
dynamic_cast<GameObject*
>(obj))
9053 const auto gobProperties = gameobject->GetGameObjectProperties();
9056 if (gameobject->isQuestGiver() || !gobProperties->itemMap.empty() || !gobProperties->goMap.empty())
9058#if VERSION_STRING < Mop
9080 auto*
const socialField = result->Fetch();
9081 socialFriend.
friendGuid = socialField[1].asUint32();
9082 socialFriend.
note = socialField[2].asCString();
9086 }
while (result->NextRow());
9096 auto*
const socialField = result->Fetch();
9097 uint32_t friendedByGuid= socialField[0].asUint32();
9101 }
while (result->NextRow());
9111 auto*
const ignoreField = result->Fetch();
9112 uint32_t ignoreGuid = ignoreField[1].asUint32();
9116 }
while (result->NextRow());
9122 if (
auto* targetPlayer =
sObjectMgr.getPlayer(name.c_str()))
9125 if (targetPlayer->getGuidLow() ==
getGuidLow())
9131 if (targetPlayer->isGMFlagSet())
9149 if (targetPlayer->getSession())
9152 targetPlayer->getZoneId(), targetPlayer->getLevel(), targetPlayer->getClass()).
serialise().get());
9165 socialFriend.
friendGuid = targetPlayer->getGuidLow();
9166 socialFriend.
note = note;
9187 return friends.friendGuid == guid;
9202 if (friends.friendGuid == guid)
9204 friends.note = note;
9205 CharacterDatabase.Execute(
"UPDATE social_friends SET note = \'%s\' WHERE character_guid = %u AND friend_guid = %u",
9216 if (friends.friendGuid == guid)
9229 if (
auto* targetPlayer =
sObjectMgr.getPlayer(friendedGuids))
9231 if (targetPlayer->getSession())
9245 std::vector<SmsgContactListMember> contactMemberList;
9255 friendListMember.
guid = friends.friendGuid;
9256 friendListMember.
flag = 0x01;
9257 friendListMember.
note = friends.note;
9259 if (
auto* plr =
sObjectMgr.getPlayer(friends.friendGuid))
9262 friendListMember.
zoneId = plr->getZoneId();
9263 friendListMember.
level = plr->getLevel();
9271 contactMemberList.push_back(friendListMember);
9288 ignoreListMember.
guid = ignoredGuid;
9289 ignoreListMember.
flag = 0x02;
9290 ignoreListMember.
note =
"";
9292 contactMemberList.push_back(ignoreListMember);
9305 if (
auto* targetPlayer =
sObjectMgr.getPlayer(name.c_str()))
9308 if (targetPlayer->getGuidLow() ==
getGuidLow())
9314 if (targetPlayer->isGMFlagSet())
9320 if (
isIgnored(targetPlayer->getGuidLow()))
9388#if VERSION_STRING > TBC
9405 if (mapMgr && mapMgr->getBaseMap()->isBattlegroundOrArena())
9408 if (battleground->hasEnded() && battleground->hasFreeSlots(
getInitialTeam(), battleground->getType()))
9426 bool success =
true;
9439 const float c_tposx = transporter->GetPositionX() +
GetTransOffsetX();
9440 const float c_tposy = transporter->GetPositionY() +
GetTransOffsetY();
9441 const float c_tposz = transporter->GetPositionZ() +
GetTransOffsetZ();
9445 if (
GetMapId() != transporter->GetMapId())
9453 SetPosition(positionOnTransport.
x, positionOnTransport.
y, positionOnTransport.
z, positionOnTransport.
o,
false);
9454 transporter->AddPassenger(
this);
9463 bool startOnGMIsland =
false;
9465 startOnGMIsland =
true;
9468 float orientation = 0;
9469 float position_x = 16222.6f;
9470 float position_y = 16265.9f;
9471 float position_z = 14.2085f;
9473 if (startOnGMIsland)
9497 auto playerInfo = std::make_unique<CachedCharacterInfo>();
9503 playerInfo->name = name;
9504 playerInfo->lastLevel =
getLevel();
9510 playerInfo->m_Group =
nullptr;
9511 playerInfo->subGroup = 0;
9526#if VERSION_STRING >= Cata
9540#if VERSION_STRING > TBC
9543 if (charEntry->cinematic_id != 0)
9565#if VERSION_STRING < Mop
9579#if VERSION_STRING > TBC
9618#if VERSION_STRING > TBC
9642 if (
const auto pPoi =
sMySQLStore.getPointOfInterest(
id))
9645 const auto name = loc ? loc->iconName : pPoi->iconName;
9681#if VERSION_STRING < Cata
9750#if VERSION_STRING > TBC
9759#if VERSION_STRING > TBC
9774#if VERSION_STRING < Cata
9783#if VERSION_STRING > TBC
9784 return getPvpFlags() & PVP_STATE_FLAG_PVP;
9793#if VERSION_STRING > TBC
9794 addPvpFlags(PVP_STATE_FLAG_PVP);
9809#if VERSION_STRING > TBC
9810 removePvpFlags(PVP_STATE_FLAG_PVP);
9821#if VERSION_STRING > TBC
9822 return getPvpFlags() & PVP_STATE_FLAG_FFA_PVP;
9831#if VERSION_STRING > TBC
9832 addPvpFlags(PVP_STATE_FLAG_FFA_PVP);
9843#if VERSION_STRING > TBC
9844 removePvpFlags(PVP_STATE_FLAG_FFA_PVP);
9854#if VERSION_STRING > TBC
9855 return getPvpFlags() & PVP_STATE_FLAG_SANCTUARY;
9856#elif VERSION_STRING == TBC
9858#elif VERSION_STRING == Classic
9865#if VERSION_STRING > TBC
9866 addPvpFlags(PVP_STATE_FLAG_SANCTUARY);
9867#elif VERSION_STRING == TBC
9876#if VERSION_STRING > TBC
9877 removePvpFlags(PVP_STATE_FLAG_SANCTUARY);
9878#elif VERSION_STRING == TBC
9900#if VERSION_STRING > TBC
9911#if VERSION_STRING > TBC
9921#if VERSION_STRING == Cata
10130#elif VERSION_STRING > Cata
10139 if (!pRewardSource)
10142 Object* player =
nullptr;
10153 return pRewardSource->
getDistance(player) <= 75.0f;
10160#if VERSION_STRING < Mop
10168#if VERSION_STRING > TBC
10169AchievementMgr* Player::getAchievementMgr() {
return m_achievementMgr.get(); }
10174 if (groupBuf && nonGroupBuf)
10181 player->getUpdateMgr().pushUpdateData(groupBuf, 1);
10183 player->getUpdateMgr().pushUpdateData(nonGroupBuf, 1);
10189 if (groupBuf && nonGroupBuf ==
nullptr)
10195 player->getUpdateMgr().pushUpdateData(groupBuf, 1);
10200 if (groupBuf ==
nullptr && nonGroupBuf)
10205 if (player->getGroup() ==
nullptr || player->getGroup()->GetID() !=
getGroup()->
GetID())
10206 player->getUpdateMgr().pushUpdateData(nonGroupBuf, 1);
10212 if (sendToSelf && groupBuf !=
nullptr)
10223 if (vendor ==
nullptr)
10237 if (plrep < vendor->reqrepvalue)
10251 sLogger.failure(
"VendorRestrictions: Mount vendor specified, but not enough m_playerCreateInfo for creature {}", vendor->
entry);
10288#if VERSION_STRING > WotLK
10333#if VERSION_STRING > WotLK
10334void Player::loadVoidStorage()
10336 auto result =
CharacterDatabase.Query(
"SELECT itemid, itemEntry, slot, creatorGuid, randomProperty, suffixFactor FROM character_void_storage WHERE playerGuid = %u",
getGuidLow());
10342 Field* fields = result->Fetch();
10353 sLogger.debug(
"Player::loadVoidStorage - Player (GUID: {}, name: {}) has an item with an invalid id (item id: %I64u, entry: {}).",
getGuidLow(),
getName(), itemId, itemEntry);
10359 sLogger.debug(
"Player::loadVoidStorage - Player (GUID: {}, name: {}) has an item with an invalid entry (item id: %I64u, entry: {}).",
getGuidLow(),
getName(), itemId, itemEntry);
10365 sLogger.debug(
"Player::loadVoidStorage - Player (GUID: {}, name: {}) has an item with an invalid slot (item id: %I64u, entry: {}, slot: {}).",
getGuidLow(),
getName(), itemId, itemEntry, slot);
10371 sLogger.debug(
"Player::loadVoidStorage - Player (GUID: {}, name: {}) has an item with an invalid creator guid, set to 0 (item id: %I64u, entry: {}, creatorGuid: {}).",
getGuidLow(),
getName(), itemId, itemEntry, creatorGuid);
10375 _voidStorageItems[slot] = std::make_unique<VoidStorageItem>(itemId, itemEntry, creatorGuid, randomProperty, suffixFactor);
10376 }
while (result->NextRow());
10379void Player::saveVoidStorage()
10385 if (!_voidStorageItems[slot])
10388 CharacterDatabase.Execute(
"DELETE FROM character_void_storage WHERE playerGuid = %u AND slot = %u ", lowGuid, slot);
10392 std::stringstream ss;
10393 ss <<
"REPLACE INTO character_void_storage VALUES(";
10394 ss << _voidStorageItems[slot]->itemId <<
",";
10395 ss << lowGuid <<
",";
10396 ss <<
uint32_t(_voidStorageItems[slot]->itemEntry) <<
",";
10397 ss << int(slot) <<
",";
10398 ss << _voidStorageItems[slot]->creatorGuid <<
",";
10399 ss << _voidStorageItems[slot]->itemRandomPropertyId <<
",";
10400 ss << _voidStorageItems[slot]->itemSuffixFactor;
10407bool Player::isVoidStorageUnlocked()
const {
return hasPlayerFlags(PLAYER_FLAG_VOID_STORAGE_UNLOCKED); }
10408void Player::unlockVoidStorage() {
addPlayerFlags(PLAYER_FLAG_VOID_STORAGE_UNLOCKED); }
10409void Player::lockVoidStorage() {
removePlayerFlags(PLAYER_FLAG_VOID_STORAGE_UNLOCKED); }
10411uint8_t Player::getNextVoidStorageFreeSlot()
const
10414 if (!_voidStorageItems[i])
10420uint8_t Player::getNumOfVoidStorageFreeSlots()
const
10425 if (!_voidStorageItems[i])
10433 int8_t slot = getNextVoidStorageFreeSlot();
10441 _voidStorageItems[slot] = std::make_unique<VoidStorageItem>(item.
itemId, item.
itemEntry,
10454 if (_voidStorageItems[slot])
10456 sLogger.debug(
"Player::addVoidStorageItemAtSlot - Player (GUID: {}, name: {}) tried to add an item to an used slot (item id: {}, entry: {}, slot: {}).",
getGuidLow(),
getName(), _voidStorageItems[slot]->itemId, _voidStorageItems[slot]->itemEntry, slot);
10461 _voidStorageItems[slot] = std::make_unique<VoidStorageItem>(item.
itemId, item.
itemEntry,
10465void Player::deleteVoidStorageItem(
uint8_t slot)
10473 _voidStorageItems[slot] =
nullptr;
10476bool Player::swapVoidStorageItem(
uint8_t oldSlot,
uint8_t newSlot)
10481 std::swap(_voidStorageItems[newSlot], _voidStorageItems[oldSlot]);
10493 return _voidStorageItems[slot] !=
nullptr ? _voidStorageItems[slot].get() :
nullptr;
10500 if (_voidStorageItems[i] && _voidStorageItems[i]->itemId ==
id)
10503 return _voidStorageItems[i].get();
10515 if (nodes.size() < 2)
10553 if (spell->getSpellInfo()->getId() != spellid)
10559 if (spell->getSpellInfo()->getId() != spellid)
10574#if VERSION_STRING > TBC
10582 m_taxi->clearTaxiDestinations();
10585 m_taxi->addTaxiDestination(sourcenode);
10595 for (
uint32_t i = 1; i < nodes.size(); ++i)
10599 lastnode = nodes[i];
10600 sTaxiMgr.getTaxiPath(prevnode, lastnode, path, cost);
10604 m_taxi->clearTaxiDestinations();
10612 if (prevnode == sourcenode)
10615 m_taxi->addTaxiDestination(lastnode);
10617 prevnode = lastnode;
10624 if ((mount_display_id == 0 && spellid == 0) || sourcepath == 0)
10627 m_taxi->clearTaxiDestinations();
10636 float discount = 1.0f;
10637 totalcost =
uint32_t(ceil(totalcost * discount));
10638 firstcost =
uint32_t(round(firstcost * discount));
10641 if (money < totalcost)
10644 m_taxi->clearTaxiDestinations();
10649#if VERSION_STRING > TBC
10650 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_FLIGHT_PATHS_TAKEN, 1);
10655#if VERSION_STRING > TBC
10656 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GOLD_SPENT_FOR_TRAVELLING, firstcost);
10669 std::vector<uint32_t> nodes;
10672 nodes[0] = entry->
from;
10673 nodes[1] = entry->
to;
10684 std::vector<uint32_t> nodes;
10687 nodes[0] = entry->
from;
10688 nodes[1] = entry->
to;
10695 m_taxi->clearTaxiDestinations();
10707 if (!mountDisplayId)
10718 float distNext =
getExactDistSq(nodeList[0]->x, nodeList[0]->y, nodeList[0]->z);
10720 for (
uint32_t i = 1; i < nodeList.size(); ++i)
10729 distPrev = distNext;
10734 (node->
x - prevNode->
x) * (node->
x - prevNode->
x) +
10735 (node->
y - prevNode->
y) * (node->
y - prevNode->
y) +
10736 (node->
z - prevNode->
z) * (node->
z - prevNode->
z);
10738 if (distNext + distPrev < distNodes)
10752 if (!itr->isCreature())
10759 if (!creature->
isTaxi())
10763 if (nearestNode == 0)
10777 return !
m_taxi->empty();
10796 Loot* pLoot =
nullptr;
10799 wowGuid.
Init(guid);
10804 if (!pCreature)
return;
10805 pLoot = &pCreature->
loot;
10844 pLoot = &pLGO->
loot;
10864 group->updateLooterGuid(go);
10870 if (groupRules && !pLoot->
empty())
10871 group->updateLooterGuid(go);
10896 pLoot = &corpse->loot;
10900 else if (wowGuid.
isItem())
10905 pLoot = pItem->
m_loot.get();
10926 switch (loot_method)
10953#if VERSION_STRING >= Cata
10960 auto item = pLoot->
items.begin();
10961 for (
uint32_t nonpersonalItemsCount = 0; item != pLoot->
items.end(); ++item, nonpersonalItemsCount++)
10963 if (item->is_looted)
10972 switch (loot_method)
10976 if (!item->is_looted && !item->is_ffa && item->isAllowedForPlayer(
this))
10986 if (item->is_blocked)
10997 if (!item->is_looted && !item->is_ffa && item->isAllowedForPlayer(
this))
11011 data <<
uint8_t(nonpersonalItemsCount);
11012 data <<
uint32_t(item->itemproto->ItemId);
11014 data <<
uint32_t(item->itemproto->DisplayInfoID);
11016 if (item->iRandomSuffix)
11021 else if (item->iRandomProperty)
11024 data <<
uint32_t(item->iRandomProperty->ID);
11037 uint32_t personalItemsCount = maxItemsCount;
11041 PersonaltemMap::const_iterator q_itr = lootPlayerQuestItems.find(
getGuidLow());
11042 if (q_itr != lootPlayerQuestItems.end())
11044 const auto& q_list = q_itr->second;
11045 for (
auto qi = q_list->cbegin(); qi != q_list->cend(); ++qi, personalItemsCount++)
11052 data <<
uint8_t(pLoot->
items.size() + (qi - q_list->cbegin()));
11079 uint32_t ffaItemsCount = maxItemsCount;
11083 PersonaltemMap::const_iterator ffa_itr = lootPlayerFFAItems.find(
getGuidLow());
11084 if (ffa_itr != lootPlayerFFAItems.end())
11086 const auto& ffa_list = ffa_itr->second;
11087 for (
auto fi = ffa_list->cbegin(); fi != ffa_list->cend(); ++fi, ffaItemsCount++)
11122 data <<
uint8_t(maxItemsCount);
11144#if VERSION_STRING < Mop
11233 if (!slotResult.Result && !
add)
11242 if (
add ==
nullptr)
11246 if (newItemHolder ==
nullptr)
11249 auto* newItem = newItemHolder.get();
11250 newItem->setStackCount(lootItem->
count);
11251 newItem->setOwnerGuid(
getGuid());
11256 newItem->applyRandomProperties(
false);
11261 newItem->applyRandomProperties(
false);
11264 const auto [addResult, _] =
getItemInterface()->
SafeAddItem(std::move(newItemHolder), slotResult.ContainerSlot, slotResult.Slot);
11267 sendItemPushResultPacket(
false,
true,
true, slotResult.ContainerSlot, slotResult.Slot, lootItem->
count, newItem->getEntry(), newItem->getPropertySeed(), newItem->getRandomPropertiesId(), newItem->getStackCount());
11268 sQuestMgr.OnPlayerItemPickup(
this, newItem);
11269#if VERSION_STRING > TBC
11270 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM, newItem->getEntry(), lootItem->
count, 0);
11271 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_TYPE, newItem->getEntry(), lootItem->
count, 0);
11272 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_EPIC_ITEM, newItem->getEntry(), lootItem->
count);
11280#if VERSION_STRING >= WotLK
11282 if (looters.size() > 1 && lootItem->
itemproto->
MaxCount == 1 && newItem->isSoulbound())
11284 newItem->setSoulboundTradeable(looters);
11287 newItem->setCreatePlayedTime(played[1]);
11296 add->setStackCount(
add->getStackCount() + lootItem->
count);
11297 add->m_isDirty =
true;
11302#if VERSION_STRING > TBC
11303 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_LOOT_ITEM,
add->getEntry(), 1, 0);
11326 flag &= ~FACTION_FLAG_AT_WAR;
11340 flag &= ~FACTION_FLAG_VISIBLE;
11352 flag &= ~FACTION_FLAG_INACTIVE;
11372 if (!factionEntry || factionEntry->
RepListId < 0)
11375 const int32_t minReputation = -42000;
11376 const int32_t exaltedReputation = 42000;
11377 const int32_t maxReputation = 42999;
11380 if (newValue < minReputation)
11381 newValue = minReputation;
11382 else if (newValue > maxReputation)
11383 newValue = maxReputation;
11393#if VERSION_STRING > TBC
11394 if (reputation->second->standing >= 42000)
11395 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION, 1, 0, 0);
11397 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION, factionEntry->
ID, reputation->second->standing, 0);
11408#if VERSION_STRING > TBC
11409 if (reputation->second->standing - newValue >= exaltedReputation)
11410 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION, -1, 0, 0);
11411 else if (newValue >= exaltedReputation)
11412 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION, 1, 0, 0);
11415 reputation->second->standing = newValue;
11418#if VERSION_STRING > TBC
11419 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION, factionEntry->
ID,
value, 0);
11425 reputation->second->standing = newValue;
11434 const ReputationMap::iterator itr =
m_reputation.find(faction);
11436 return itr->second->standing;
11442 const ReputationMap::iterator itr =
m_reputation.find(faction);
11444 return itr->second->baseStanding;
11451 if (factionEntry ==
nullptr || factionEntry->
RepListId < 0)
11454 const int32_t minReputation = -42000;
11455 const int32_t exaltedReputation = 42000;
11456 const int32_t maxReputation = 42999;
11458 if ((
getWorldMap()->getBaseMap()->getMapInfo()->minlevel == 80 ||
11464 if (newValue < minReputation)
11465 newValue = minReputation;
11466 else if (newValue > maxReputation)
11467 newValue = maxReputation;
11469 ReputationMap::iterator itr =
m_reputation.find(faction);
11477#if VERSION_STRING > TBC
11478 if (itr->second->standing >= 42000)
11479 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION, 1, 0, 0);
11481 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION, factionEntry->
ID, itr->second->standing, 0);
11492 if (
RankChanged(itr->second->standing, newValue))
11494 itr->second->standing += newValue;
11497#if VERSION_STRING > TBC
11498 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_REPUTATION, factionEntry->
ID, itr->second->standing, 0);
11499 if (itr->second->standing >= exaltedReputation)
11500 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION, 1, 0, 0);
11501 else if (itr->second->standing - newValue >= exaltedReputation)
11502 updateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_GAIN_EXALTED_REPUTATION, -1, 0, 0);
11508 itr->second->standing += newValue;
11511 if (itr->second->standing < minReputation)
11512 itr->second->standing = minReputation;
11513 else if (itr->second->standing > maxReputation)
11514 itr->second->standing = maxReputation;
11526 if (
value >= 42000)
11528 if (
value >= 21000)
11560 if (faction >= 128)
11564 if (!factionReputation)
11583 if (factionState ==
nullptr)
11600 if (factionReputation ==
nullptr)
11614 if (!object->isCreatureOrPlayer())
11617 if (
const auto unit =
dynamic_cast<Unit*
>(
object))
11619 if (unit->m_factionEntry ==
nullptr || unit->m_factionEntry->RepListId < 0)
11625 if (isHostile && !currentHostileObject)
11627 else if (!isHostile && currentHostileObject)
11645 m_Group->getLock().lock();
11647 for (
uint32_t i = 0; i < m_Group->GetSubGroupCount(); ++i)
11648 for (
auto groupMember : m_Group->GetSubGroup(i)->getGroupMembers())
11649 if (
auto player =
sObjectMgr.getPlayer(groupMember->guid))
11650 if (player->isInRange(
this, 100.0f))
11651 player->onKillUnitReputation(unit,
true);
11653 m_Group->getLock().unlock();
11661 if (modifier !=
nullptr)
11663 for (
auto& mod : modifier->mods)
11665 if (!mod->faction[team])
11691 if (!factionEntry || factionEntry->
RepListId < 0)
11695 if (factionReputation ==
nullptr)
11705 if (!factionReputation)
11711 if (!factionEntry || factionEntry->
RepListId < 0)
11714 for (
uint8_t i = 0; i < 4; ++i)
11721 const auto baseStanding = factionEntry->
baseRepValue[i];
11722 const auto m_standing = (base) ? factionEntry->
baseRepValue[i] : standing;
11724 const auto [repItr, _] =
m_reputation.insert_or_assign(factionEntry->
ID, std::make_unique<FactionReputation>(m_standing, flag, baseStanding));
11735 if (!factionEntry || !reputation)
11754 const int32_t exaltedReputation = 42000;
11755 if (itr->second->standing >= exaltedReputation)
11759 return exaltedCount;
11764#if VERSION_STRING == Mop
11765 const uint16_t factionCount = 256;
11770 for (; a != factionCount; ++a)
11787 if (!factionReputation)
11794 data << factionReputation->
flag;
11815 return raceEntry->faction_id;
11838 if (newDrunkenState == oldDrunkenState)
11853 if (
value >= 23000)
11856 if (
value >= 12800)
11859 if (
value & 0xFFFE)
11899 goFlag->setCreatedByGuid(
getGuid());
11993 if (aur ==
nullptr)
11996 if (aur->WasCastInDuel())
12011 if (aur ==
nullptr)
12013 if (aur->WasCastInDuel())
12022 if (condition != 0)
12045 summon->getCombatHandler().clearCombat();
12046 summon->getAIInterface()->setPetOwner(
this);
12048 summon->getThreatManager().clearAllThreat();
12049 summon->getThreatManager().removeMeFromThreatLists();
12054 duelingWithSummon->getCombatHandler().clearCombat();
12055 duelingWithSummon->getAIInterface()->setPetOwner(
this);
12056 duelingWithSummon->getAIInterface()->handleEvent(
EVENT_FOLLOWOWNER, duelingWithSummon, 0);
12057 duelingWithSummon->getThreatManager().clearAllThreat();
12058 duelingWithSummon->getThreatManager().removeMeFromThreatLists();
12138#if VERSION_STRING >= Cata
12145 guild->giveXP(guild_share,
this);
12170 bool levelup =
false;
12172 while (newXp >= nextLevelXp && newXp > 0)
12177 newXp -= nextLevelXp;
12178 nextLevelXp =
sMySQLStore.getPlayerXPForLevel(level);
12212 if (restAmount < 0)
12230 auto restXp =
static_cast<uint32_t>(0.05f * nextLevelXp * (seconds / (3600 * (8 / restXpRate))));
12237 if (
m_restAmount > nextLevelXp +
static_cast<uint32_t>(
static_cast<float>(nextLevelXp >> 1) * restXpRate))
12238 m_restAmount = nextLevelXp +
static_cast<uint32_t>(
static_cast<float>(nextLevelXp >> 1) * restXpRate);
12280 return itr->second.get();
12289 return itr->second.get();
12312 const auto itr = std::as_const(
m_cachedPets).find(petId);
12315 std::erase_if(
m_cachedPetSlots, [petId](
const auto& slotItr) {
return slotItr.second == petId; });
12339 return itr->second;
12341 return std::nullopt;
12351 std::optional<uint8_t> foundSlot = std::nullopt;
12365 std::optional<uint8_t> foundSlot = std::nullopt;
12382 const auto petItr = std::as_const(
m_cachedPets).find(petId);
12392 if (petItr->second->slot == newSlot)
12400 auto* oldSlotPet = petItr->second.get();
12407 const auto existingPetItr = std::as_const(
m_cachedPets).find(slotItr->second);
12409 newSlotPet = existingPetItr->second.get();
12415#if VERSION_STRING >= WotLK
12416 if (isNewSlotActiveSlot)
12419 if (
const auto creatureProperties =
sMySQLStore.getCreatureProperties(oldSlotPet->entry))
12431 if (isOldSlotActiveSlot && !isNewSlotActiveSlot && newSlotPet !=
nullptr)
12434 if (
const auto creatureProperties =
sMySQLStore.getCreatureProperties(newSlotPet->
entry))
12447 if (!isNewSlotActiveSlot)
12460 if (newSlotPet !=
nullptr)
12466 if (newSlotPet !=
nullptr)
12467 newSlotPet->
slot = oldSlotPet->slot;
12468 oldSlotPet->slot = newSlot;
12470 auto requiresPetSave =
false;
12471 if (isOldSlotActiveSlot && !isNewSlotActiveSlot)
12474 auto*
const currentPet =
getPet();
12475 if (currentPet !=
nullptr && currentPet->getPetId() == petId)
12477 currentPet->unSummon();
12484 if (newSlotPet !=
nullptr)
12485 newSlotPet->
active = oldSlotPet->active;
12486 oldSlotPet->active =
false;
12487 requiresPetSave =
true;
12490 else if (!isOldSlotActiveSlot && isNewSlotActiveSlot)
12493 if (newSlotPet !=
nullptr)
12495 auto*
const currentPet =
getPet();
12497 if (currentPet !=
nullptr && currentPet->getPetId() == newSlotPet->
number)
12499 currentPet->unSummon();
12506 oldSlotPet->active = newSlotPet->
active;
12507 newSlotPet->
active =
false;
12508 requiresPetSave =
true;
12513 requiresPetSave =
true;
12516 else if ((!isOldSlotActiveSlot && !isNewSlotActiveSlot) || (isOldSlotActiveSlot && isNewSlotActiveSlot))
12520 requiresPetSave =
true;
12523 if (requiresPetSave)
12526 CharacterDatabase.Execute(
"UPDATE playerpets SET slot = %u, active = %u WHERE ownerguid = %u AND petnumber = %u",
12527 oldSlotPet->slot, oldSlotPet->active,
getGuidLow(), oldSlotPet->number);
12528 if (newSlotPet !=
nullptr)
12530 CharacterDatabase.Execute(
"UPDATE playerpets SET slot = %u, active = %u WHERE ownerguid = %u AND petnumber = %u",
12543 sLogger.failure(
"Player::spawnPet : {} tried to load invalid pet {}", std::to_string(
getGuid()), petId);
12549 sLogger.debug(
"Player::spawnPet : {} tried to spawn pet from stable slot {}", std::to_string(
getGuid()), std::to_string(itr->second.get()->slot));
12558 if (
getPet() !=
nullptr)
12571 if (petCache !=
nullptr && petCache->active)
12575 if (petCache->alive)
12578 petCache->active =
false;
12587 if (
getPet() ==
nullptr)
12603#if VERSION_STRING == TBC || VERSION_STRING == WotLK
12610 if (
const auto*
const pet =
getPet())
12612 if (!pet->isAlive())
12615 if (!pet->isPermanentSummon())
12636 for (
const auto& [slot, petId] : std::as_const(copiedCachedSlots))
12643 if (petCache ==
nullptr)
12646 if (petCache->active)
12650 petCache->active =
false;
12671 if (
const auto spellInfo =
sSpellMgr.getSpellInfo(spellId))
12677 Spell* spell =
sSpellMgr.newSpell(
this, spellInfo,
true,
nullptr);
12685 Spell* spell =
sSpellMgr.newSpell(
this, spellInfo,
true,
nullptr);
12693 aura->removeAura();
12701 aura->removeAura();
12710 if (!pet->loadFromDB(
this, petCache))
12737 auto result =
CharacterDatabase.Query(
"SELECT id, permanent, map, difficulty, extendState, resettime FROM character_instance LEFT JOIN instance ON instance = id WHERE guid = %u",
getGuidLow());
12742 Field* fields = result->Fetch();
12744 bool perm = fields[1].
asBool();
12750 time_t resetTime = time_t(fields[5].asUint64());
12751 bool deleteInstance =
false;
12754#if VERSION_STRING > WotLK
12755 std::string mapname = mapEntry ? mapEntry->
map_name[0] :
"Unknown";
12757 std::string mapname = mapEntry ? mapEntry->
map_name[
sWorld.getDbcLocaleLanguageId()] :
"Unknown";
12762 sLogger.failure(
"Player::loadBoundInstances: Player '{}' ({}) has bind to not existed or not dungeon map {} ({})",
12764 deleteInstance =
true;
12768 sLogger.failure(
"entities.player",
"Player::loadBoundInstances: player '{}' ({}) has bind to not existed difficulty {} instance for map {} ({})",
12770 deleteInstance =
true;
12777 sLogger.failure(
"entities.player",
"Player::loadBoundInstances: player '{}' ({}) has bind to not existed difficulty {} instance for map {} ({})",
12779 deleteInstance =
true;
12781 else if (!perm && group)
12783 sLogger.failure(
"entities.player",
"Player::loadBoundInstances: player '{}' ({}) is in group {} but has a non-permanent character bind to map {} ({}), {}, {}",
12784 getName(),
getGuid(), group->GetGUID(), mapId, mapname, instanceId, difficulty);
12785 deleteInstance =
true;
12789 if (deleteInstance)
12799 }
while (result->NextRow());
12805#if VERSION_STRING > TBC
12812 BoundInstancesMap::iterator itr =
m_boundInstances[difficulty].find(mapId);
12814 if (itr->second.extendState || withExpired)
12815 return &itr->second;
12823 if (!pBind || !pBind->
perm)
12826 pSave = groupBind->save;
12833 BoundInstancesMap::iterator itr =
m_boundInstances[difficulty].find(mapid);
12843 CharacterDatabase.Execute(
"DELETE FROM character_instance WHERE guid = %u AND instance = %u",
getGuidLow(), itr->second.save->getInstanceId());
12846#if VERSION_STRING > TBC
12847 if (itr->second.perm)
12850 itr->second.save->removePlayer(
this);
12879 CharacterDatabase.Execute(
"INSERT INTO character_instance (guid, instance, permanent, extendState) VALUES (%u, %u, %u, %u)",
getGuidLow(),
save->getInstanceId(), permanent, extendState);
12888 save->addPlayer(
this);
12892 save->setCanReset(
false);
12895 bind.
perm = permanent;
12915#if VERSION_STRING > TBC
12933 size_t p_counter = data.
wpos();
12947#if VERSION_STRING > TBC
12953 time_t nextReset =
save->getResetTime();
12957 data <<
uint32_t(nextReset - now);
12959 time_t nextReset =
save->getResetTime();
12963 data <<
uint32_t(nextReset - now);
12979 bool hasBeenSaved =
false;
12986 if (itr->second.perm)
12988 hasBeenSaved =
true;
13006 if (itr->second.perm)
13009 data <<
uint32_t(itr->second.save->getMapId());
13022 else if (time > 21600)
13024 else if (time > 3600)
13026 else if (time > 300)
13075 if (
map &&
map->getBaseMap()->isInstanceMap())
13108 auto result =
CharacterDatabase.Query(
"SELECT instanceId, releaseTime FROM account_instance_times WHERE accountId = %u",
getSession()->GetAccountId());
13114 Field* fields = result->Fetch();
13115 m_instanceResetTimes.insert(InstanceTimeMap::value_type(fields[0].asUint32(), fields[1].asUint64()));
13116 }
while (result->NextRow());
13160 if (arenaTeamMember->PersonalRating > maxRating)
13161 maxRating = arenaTeamMember->PersonalRating;
13176 if (
string ==
nullptr)
13179 char* start = (
char*)
string;
13180 for (
uint16_t Counter = 0; Counter < fieldsNum; Counter++)
13182 char* end = strchr(start,
',');
13196#if VERSION_STRING != Classic
13202 SpellInfo const* spellInfo = aurEff->getAura()->getSpellInfo();
13203 int32_t val = aurEff->getEffectDamage();
13219 if (reqskillMH != 0 || reqskillOH != 0)
13234#if VERSION_STRING == WotLK
13240 uint64_t newval = oldval | (1LL << (currency_type_entry->bit_index - 1));
13246 uint64_t newval = oldval & ~(1LL << (currency_type_entry->bit_index - 1));
13251 if (itemId == 0 || apply) {
return; }
13258 sLootMgr.fillItemLoot(
this, &loot1, itemId, 0);
13260 for (
const auto& item : loot1.
items)
13262 uint32_t looteditemid = item.itemproto->ItemId;
13272 if (instance->getScript())
13273 instance->getScript()->displayDataStateList(
this);
13279 if (instance->getScript())
13280 instance->getScript()->displayTimerList(
this);
13285 if (instance->getScript())
13286 instance->getScript()->getCreatureSetForEntry(_creatureEntry,
true,
this);
13291 std::stringstream dmglog;
13293 if ((spellId != 0) && (
worldConfig.limit.maxSpellDamageCap > 0))
13295 if (damage >
worldConfig.limit.maxSpellDamageCap)
13297 dmglog <<
"Dealt " << damage <<
" with spell " << spellId;
13301 if (
worldConfig.limit.disconnectPlayerForExceedingLimits != 0)
13307 else if ((
worldConfig.limit.maxAutoAttackDamageCap > 0) && (damage >
worldConfig.limit.maxAutoAttackDamageCap))
13309 dmglog <<
"Dealt " << damage <<
" with auto attack";
13312 if (
worldConfig.limit.disconnectPlayerForExceedingLimits != 0)
13315 damage =
worldConfig.limit.maxAutoAttackDamageCap;
13318 if (
worldConfig.limit.broadcastMessageToGmOnExceeding != 0)
13331 if (block_multiplier < 1.0f)
13332 block_multiplier = 1.0f;
13339 float feralAttackPower = 0.0f;
13341 Item* applyItem = item;
13342 if (applyItem ==
nullptr)
13348 delay = std::max(1.0f, delay);
13351 feralAttackPower = (dps - 54.8f) * 14;
13358 if (!newCharacter && (
buf ==
nullptr))
13361 std::stringstream ds;
13364 ds <<
"DELETE FROM playerreputations WHERE guid = '";
13369 buf->AddQueryStr(ds.str());
13375 std::stringstream ss;
13377 ss <<
"INSERT INTO playerreputations VALUES('";
13379 ss << itr->first <<
"','";
13380 ss <<
uint32_t(itr->second->flag) <<
"','";
13381 ss << itr->second->baseStanding <<
"','";
13382 ss << itr->second->standing <<
"');";
13385 buf->AddQueryStr(ss.str());
13395 if (!newCharacter &&
buf ==
nullptr)
13398 std::stringstream ds;
13401 ds <<
"DELETE FROM playerspells WHERE GUID = '";
13406 buf->AddQueryStr(ds.str());
13412 std::stringstream ss;
13414 ss <<
"INSERT INTO playerspells VALUES('";
13415 ss << guid <<
"','";
13416 ss << spellid <<
"');";
13419 buf->AddQueryStr(ss.str());
13429 if (result ==
nullptr)
13437 const auto*
const spellInfo =
sSpellMgr.getSpellInfo(spellid);
13438 if (spellInfo ==
nullptr)
13441 if (
sSpellMgr.isSpellDisabled(spellid))
13452 if (!newCharacter &&
buf ==
nullptr)
13455 std::stringstream ds;
13458 ds <<
"DELETE FROM playerdeletedspells WHERE GUID = '";
13463 buf->AddQueryStr(ds.str());
13469 std::stringstream ss;
13471 ss <<
"INSERT INTO playerdeletedspells VALUES('";
13472 ss << guid <<
"','";
13473 ss << spellid <<
"');";
13476 buf->AddQueryStr(ss.str());
13486 if (!newCharacter &&
buf ==
nullptr)
13489 std::stringstream ds;
13492 ds <<
"DELETE FROM playerskills WHERE GUID = '";
13497 buf->AddQueryStr(ds.str());
13501 for (SkillMap::iterator itr =
m_skills.begin(); itr !=
m_skills.end(); ++itr)
13504 uint32_t currval = itr->second.CurrentValue;
13505 uint32_t maxval = itr->second.MaximumValue;
13511 std::stringstream ss;
13513 ss <<
"INSERT INTO playerskills VALUES('";
13514 ss << guid <<
"','";
13515 ss << skillid <<
"','";
13516 ss << currval <<
"','";
13517 ss << maxval <<
"');";
13520 buf->AddQueryStr(ss.str());
13549 for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
13550 if (itr->second->autoCast && itr->second->fitsToRequirements(
this, ZoneId, AreaId))
13552 castSpell(
this, itr->second->spellId,
true);
13557 for (SpellAreaForAreaMap::const_iterator itr = szBounds.first; itr != szBounds.second; ++itr)
13558 if (itr->second->autoCast && itr->second->fitsToRequirements(
this, ZoneId, AreaId))
13560 castSpell(
this, itr->second->spellId,
true);
13568 if (
sSpellMgr.checkLocation(aur->getSpellInfo(), ZoneId, AreaId,
this) ==
false)
13571 if (sab.first != sab.second)
13602#if VERSION_STRING >= TBC
13606 else if (shapeShiftForm ==
FORM_CAT)
13626 Unit* pVictim =
nullptr;
13632 sLogger.info(
"Player::Update: No valid current selection to attack, stopping attack");
13649#if VERSION_STRING < Mop
13661#if VERSION_STRING < Mop
13721 sLogger.info(
"Player::Update: No valid current selection to attack, stopping attack");
13740 else if (!currentCharm->
isInFront(pVictim))
13744#if VERSION_STRING < Mop
13756 currentCharm->
strike(pVictim,
MELEE,
nullptr, 0, 0, 0,
false,
false);
13762 Spell* spell =
sSpellMgr.newSpell(currentCharm, spellInfo,
true,
nullptr);
13797 if (
buf ==
nullptr)
13800 buf->AddQuery(
"DELETE FROM playerpets WHERE ownerguid = %u",
getGuidLow());
13802 const auto* summon = currentPet !=
nullptr ? currentPet :
getPet();
13803 if (summon && summon->IsInWorld())
13805 if (updateCurrentPetCache)
13807 const auto playerPetCache =
getPetCache(summon->getPetId());
13808 if (playerPetCache !=
nullptr && playerPetCache->active)
13809 summon->updatePetInfo(
false);
13811 summon->updatePetInfo(
true);
13814 if (summon->isHunterPet())
13817 auto pn = summon->getPetId();
13818 if (
buf ==
nullptr)
13821 buf->AddQuery(
"DELETE FROM playerpetspells WHERE ownerguid=%u AND petnumber=%u",
getGuidLow(), pn);
13823 for (
const auto& [spell, state] : summon->getSpellMap())
13825 if (
buf ==
nullptr)
13828 buf->AddQuery(
"INSERT INTO playerpetspells VALUES(%u, %u, %u, %u)",
getGuidLow(), pn, spell, state);
13833 std::stringstream ss;
13835 ss.rdbuf()->str(
"");
13837 std::optional<uint8_t> currentPetId = std::nullopt;
13841 std::vector<uint8_t> savedPetIds;
13844 auto foundActivePet =
false;
13847 auto* petCache = itr->second.get();
13850 if (currentPetId.has_value())
13853 if (petCache->active && petCache->number != currentPetId.value())
13854 petCache->active =
false;
13859 if (petCache->number != currentPetId.value())
13861 std::erase_if(
m_cachedPetSlots, [&petCache](
const auto& slotItr) {
return slotItr.second == petCache->number; });
13870 if (petCache->active)
13873 petCache->active =
false;
13874 else if (foundActivePet)
13875 petCache->active =
false;
13877 foundActivePet =
true;
13883 if (!petCache->active)
13885 std::erase_if(
m_cachedPetSlots, [&petCache](
const auto& slotItr) {
return slotItr.second == petCache->number; });
13892 ss.rdbuf()->str(
"");
13894 ss <<
"REPLACE INTO playerpets VALUES('"
13896 << std::to_string(petCache->number) <<
"','"
13897 << std::to_string(petCache->type) <<
"','"
13898 << petCache->name <<
"','"
13899 << petCache->entry <<
"','"
13900 << petCache->model <<
"','"
13901 << petCache->level <<
"','"
13902 << petCache->xp <<
"','"
13903 << std::to_string(petCache->slot) <<
"','"
13904 << petCache->active <<
"','"
13905 << petCache->alive <<
"','"
13906 << petCache->actionbar <<
"','"
13907 <<
static_cast<long>(petCache->reset_time) <<
"','"
13908 << petCache->reset_cost <<
"','"
13909 << petCache->spellid <<
"','"
13910 << std::to_string(petCache->petstate) <<
"','"
13911 << petCache->talentpoints <<
"','"
13912 << petCache->current_power <<
"','"
13913 << petCache->current_hp <<
"','"
13914 << petCache->current_happiness <<
"','"
13915 << petCache->renamable <<
"')";
13917 if (
buf ==
nullptr)
13920 buf->AddQueryStr(ss.str());
13922 savedPetIds.push_back(petCache->number);
13927 ss.rdbuf()->str(
"");
13928 ss <<
"DELETE FROM playerpetspells WHERE ownerguid=" <<
getGuidLow();
13929 if (!savedPetIds.empty())
13931 ss <<
" AND petnumber NOT IN (";
13932 for (
auto itr = savedPetIds.cbegin(); itr != savedPetIds.cend();)
13934 ss << std::to_string(*itr);
13935 if (++itr != savedPetIds.cend())
13942 if (
buf ==
nullptr)
13945 buf->AddQueryStr(ss.str());
13951 if (
buf ==
nullptr)
13954 buf->AddQuery(
"DELETE FROM playersummonspells WHERE ownerguid=%u",
getGuidLow());
13959 for (std::set<uint32_t>::iterator it = itr->second.begin(); it != itr->second.end(); ++it)
13961 if (
buf ==
nullptr)
13964 buf->AddQuery(
"INSERT INTO playersummonspells VALUES(%u, %u, %u)",
getGuidLow(), itr->first, (*it));
13972 std::map<uint32_t, std::set<uint32_t> >::iterator itr =
m_summonSpells.find(entry);
13981 std::set<uint32_t>::iterator it3;
13982 for (std::set<uint32_t>::iterator it2 = itr->second.begin(); it2 != itr->second.end();)
13985 const auto se =
sSpellMgr.getSpellInfo(*it3);
13986 if (se ==
nullptr || !se->hasSpellRanks())
13990 itr->second.erase(it3);
13993 itr->second.insert(spellId);
13999 std::map<uint32_t, std::set<uint32_t> >::iterator itr =
m_summonSpells.find(entry);
14002 itr->second.erase(spellId);
14003 if (itr->second.size() == 0)
14010 std::map<uint32_t, std::set<uint32_t> >::iterator itr =
m_summonSpells.find(entry);
14012 return &itr->second;
14027 auto pet = std::make_unique<PetCache>();
14028 pet->number = fields[1].
asUint8();
14029 pet->type = fields[2].
asUint8();
14031 pet->entry = fields[4].
asUint32();
14034 const auto creatureProperties =
sMySQLStore.getCreatureProperties(pet->entry);
14035 if (creatureProperties ==
nullptr)
14038 pet->model = fields[5].
asUint32();
14039 pet->level = fields[6].
asUint32();
14041 pet->slot = fields[8].
asUint8();
14042 pet->active = fields[9].
asBool();
14043 pet->alive = fields[10].
asBool();
14044 pet->actionbar = fields[11].
asCString();
14045 pet->reset_time = fields[12].
asUint32();
14046 pet->reset_cost = fields[13].
asUint32();
14047 pet->spellid = fields[14].
asUint32();
14048 pet->petstate = fields[15].
asUint8();
14049 pet->talentpoints = fields[16].
asUint32();
14050 pet->current_power = fields[17].
asUint32();
14051 pet->current_hp = fields[18].
asUint32();
14052 pet->current_happiness = fields[19].
asUint32();
14053 pet->renamable = fields[20].
asBool();
14059#
if VERSION_STRING < Cata
14071#if VERSION_STRING >= Cata
14072 auto foundNewSlot =
false;
14077 if (freeActiveSlot.has_value())
14079 pet->slot = freeActiveSlot.value();
14080 foundNewSlot =
true;
14089 if (!freeStableSlot.has_value())
14095 pet->slot = freeStableSlot.value();
14103 if (!pet->active || !pet->alive)
14109 pet->active =
false;
14134 bool in_arena =
false;
14135 std::unique_ptr<QueryBuffer> bufPtr =
nullptr;
14139 bufPtr = std::make_unique<QueryBuffer>();
14140 buf = bufPtr.get();
14173 std::stringstream ss;
14189#if VERSION_STRING > Classic
14190 << getChosenTitle() <<
", "
14195#if VERSION_STRING > Classic
14196 << getKnownTitles(0) <<
", "
14201#if VERSION_STRING < WotLK
14204 << getKnownTitles(1) <<
", " << getKnownTitles(2) <<
", "
14211#if VERSION_STRING < Cata
14212 ss << getAmmoId() <<
", ";
14237#if VERSION_STRING < WotLK
14242#if VERSION_STRING >= WotLK
14247#if VERSION_STRING == TBC
14265 ss <<
m_taxi->saveTaximaskNodeToString();
14272 if (
getSession()->_loggingOut || newCharacter)
14295 ss <<
m_taxi->saveTaxiDestinationsToString();
14300 ss << flight->getCurrentNode() <<
", ";
14306 ss <<
uint32_t(0) <<
",'0','0','0','0'" <<
", ";
14323 ss <<
uint32_t(m_specs[s].getActionButton(i).Action) <<
","
14324 <<
uint32_t(m_specs[s].getActionButton(i).Type) <<
","
14325 <<
uint32_t(m_specs[s].getActionButton(i).
Misc) <<
",";
14337 ss <<
"'" <<
", " <<
"''" <<
", ";
14347 ss <<
"''" <<
", ";
14353 ss << (*finishedQuests) <<
",";
14359 ss << finishedDailies <<
",";
14375 for (
const auto& [talentId, rank] : m_specs[s].getTalents())
14383 ss << talentId <<
"," << rank <<
",";
14385 ss <<
"', '', '', ";
14398#if VERSION_STRING < Cata
14399 ss <<
"'" <<
uint32_t(0) <<
"', ";
14404 ss <<
"'" <<
m_phase <<
"', ";
14411 ss <<
"'" << xpfield <<
"'" <<
", ";
14413 const bool saveData =
worldConfig.server.saveExtendedCharData;
14439 buf->AddQueryNA(ss.str().c_str());
14457 if (ticket !=
nullptr)
14473#if VERSION_STRING > TBC
14474 m_achievementMgr->saveToDb(
buf);
14485 if (
buf ==
nullptr)
14488 buf->AddQuery(
"DELETE FROM questlog WHERE player_guid=%u AND quest_id=%u",
getGuidLow(), removeableQuestId);
14495 if (questlogEntry !=
nullptr)
14496 questlogEntry->saveToDB(
buf);
14529 q->AddQuery(
"SELECT * FROM characters WHERE guid = %u AND login_flags = %u", guid, (
uint32_t)
LOGIN_NO_FLAG);
14530 q->AddQuery(
"SELECT * FROM tutorials WHERE playerId = %u", guid);
14531 q->AddQuery(
"SELECT cooldown_type, cooldown_misc, cooldown_expire_time, cooldown_spellid, cooldown_itemid FROM playercooldowns WHERE player_guid = %u", guid);
14532 q->AddQuery(
"SELECT * FROM questlog WHERE player_guid = %u", guid);
14533 q->AddQuery(
"SELECT * FROM playeritems WHERE ownerguid = %u ORDER BY containerslot ASC", guid);
14534 q->AddQuery(
"SELECT * FROM playerpets WHERE ownerguid = %u ORDER BY petnumber", guid);
14535 q->AddQuery(
"SELECT * FROM playersummonspells where ownerguid = %u ORDER BY entryid", guid);
14536 q->AddQuery(
"SELECT * FROM mailbox WHERE player_guid = %u", guid);
14539 q->AddQuery(
"SELECT friend_guid, note FROM social_friends WHERE character_guid = %u", guid);
14540 q->AddQuery(
"SELECT character_guid FROM social_friends WHERE friend_guid = %u", guid);
14541 q->AddQuery(
"SELECT ignore_guid FROM social_ignores WHERE character_guid = %u", guid);
14544 q->AddQuery(
"SELECT * FROM equipmentsets WHERE ownerguid = %u", guid);
14545 q->AddQuery(
"SELECT faction, flag, basestanding, standing FROM playerreputations WHERE guid = %u", guid);
14546 q->AddQuery(
"SELECT SpellID FROM playerspells WHERE GUID = %u", guid);
14547 q->AddQuery(
"SELECT SpellID FROM playerdeletedspells WHERE GUID = %u", guid);
14548 q->AddQuery(
"SELECT SkillID, CurrentValue, MaximumValue FROM playerskills WHERE GUID = %u", guid);
14551 q->AddQuery(
"SELECT achievement, date FROM character_achievement WHERE guid = '%u'", guid);
14552 q->AddQuery(
"SELECT criteria, counter, date FROM character_achievement_progress WHERE guid = '%u'", guid);
14564 if (
getSession() ==
nullptr || results.size() < 8)
14581 sLogger.failure(
"Expected {} fields from the database, but received {}! You may need to update your character database.", fieldcount,
uint32_t(result->
GetFieldCount()));
14589 sCheatLog.writefromsession(
m_session,
"player tried to load character not belonging to them (guid %u, on account %u)",
14616 sLogger.failure(
"guid {} failed to login, no race or class dbc found. (race {} class {})",
getGuidLow(), (
unsigned int)
getRace(), (
unsigned int)
getClass());
14653#if VERSION_STRING > TBC
14695#if VERSION_STRING >= Cata
14701#if VERSION_STRING > Classic
14702 setChosenTitle(
field[12].asUint32());
14703 setKnownTitles(0,
field[13].asUint64());
14704#if VERSION_STRING > TBC
14705 setKnownTitles(1,
field[14].asUint64());
14706 setKnownTitles(2,
field[15].asUint64());
14712#if VERSION_STRING < Cata
14713 setAmmoId(
field[17].asUint32());
14745#if VERSION_STRING > TBC
14800 std::string tmpStr =
field[46].asCString();
14811 std::stringstream dmgLog;
14815 if (
worldConfig.limit.broadcastMessageToGmOnExceeding)
14818 if (
worldConfig.limit.disconnectPlayerForExceedingLimits)
14834 std::string taxi_nodes =
field[60].asCString();
14838 float transportX =
field[63].asFloat();
14839 float transportY =
field[64].asFloat();
14840 float transportZ =
field[65].asFloat();
14841 float transportO =
field[66].asFloat();
14843 if (transportGuid != 0)
14856 char* start =
nullptr;
14857 char* end =
nullptr;
14858#if VERSION_STRING > TBC
14861 start = (
char*)
field[67 + s].asCString();
14865 if (start ==
nullptr)
14868 end = strchr(start,
',');
14872 m_specs[0 + s].getActionButton(Counter).Action = std::stoul(start);
14874 end = strchr(start,
',');
14878 m_specs[0 + s].getActionButton(Counter).Type =
static_cast<uint8_t>(std::stoul(start));
14880 end = strchr(start,
',');
14884 m_specs[0 + s].getActionButton(Counter).Misc =
static_cast<uint8_t>(std::stoul(start));
14894 start = (
char*)
field[67].asCString();
14898 if (start ==
nullptr)
14901 end = strchr(start,
',');
14905 spec.getActionButton(Counter).Action = (
uint32_t)std::stoul(start);
14907 end = strchr(start,
',');
14911 spec.getActionButton(Counter).Type = (
uint8_t)std::stoul(start);
14913 end = strchr(start,
',');
14917 spec.getActionButton(Counter).Misc = (
uint8_t)std::stoul(start);
14933 std::istringstream savedPlayerBuffsStream(
field[69].asCString());
14934 std::string auraId, auraDuration, auraPositivValue, auraCharges;
14936 while (std::getline(savedPlayerBuffsStream, auraId,
','))
14939 la.
id = std::stoul(auraId.c_str());
14941 std::getline(savedPlayerBuffsStream, auraDuration,
',');
14942 la.
dur = std::stoul(auraDuration.c_str());
14944 std::getline(savedPlayerBuffsStream, auraPositivValue,
',');
14947 std::getline(savedPlayerBuffsStream, auraCharges,
',');
14948 la.
charges = std::stoul(auraCharges.c_str());
14955 start = (
char*)
field[70].asCString();
14958 end = strchr(start,
',');
14961 const uint32_t questEntry = std::stoul(start);
14965 auto questProperties =
sMySQLStore.getQuestProperties(questEntry);
14966 if (questProperties !=
nullptr && questProperties->rewardtalents > 0)
14972 start = (
char*)
field[71].asCString();
14975 end = strchr(start,
',');
14992 std::stringstream dmgLog;
14997 if (
worldConfig.limit.broadcastMessageToGmOnExceeding)
15000 if (
worldConfig.limit.disconnectPlayerForExceedingLimits)
15011 if (timediff > 900)
15014 soberFactor = 1 - timediff / 900;
15018#if VERSION_STRING > TBC
15021 start = (
char*)
field[80 + 2 * s].asCString();
15025 end = strchr(start,
',');
15028 m_specs[s].setGlyph(
static_cast<uint16_t>(std::stoul(start)), glyphid);
15034 start = (
char*)
field[81 + 2 * s].asCString();
15035 while (end !=
nullptr)
15037 end = strchr(start,
',');
15041 uint32_t talentid = std::stoul(start);
15044 end = strchr(start,
',');
15051 m_specs[s].addTalent(talentid, rank);
15059 start = (
char*)
field[81].asCString();
15060 while (end !=
nullptr)
15062 end = strchr(start,
',');
15066 uint32_t talentid = std::stoul(start);
15069 end = strchr(start,
',');
15076 spec.addTalent(talentid, rank);
15084#if VERSION_STRING > TBC
15086 if (
auto talentPoints =
field[86].asCString())
15091 for (
uint8_t i = 0; i < 2; ++i)
15092 tps[i] = std::stoi(talentPointsVector[i]);
15097#if VERSION_STRING < Cata
15103 if (
auto talentPoints =
field[86].asCString())
15108 for (
uint8_t i = 0; i < 2; ++i)
15109 tps[i] = std::stoi(talentPointsVector[i]);
15118#if VERSION_STRING >= Cata
15133 if (
field[91].asUint32() == 1)
15139 if (
field[92].asUint32() == 1)
15149#if VERSION_STRING > TBC
15161#if VERSION_STRING >= WotLK
15180#if VERSION_STRING > WotLK
15208#if VERSION_STRING > TBC
15211 m_achievementMgr->updateAllAchievementCriteria();
15220 setCorpseData(corpse->GetPosition(), corpse->GetInstanceID());
15223#if VERSION_STRING > Classic
15248 for (i = 0; i < nuniques; i++)
15250 if (uniques[i] == ip->
ItemId)
15259 uniques[nuniques++] = ip->
ItemId;
15268 if (!taxi_nodes.empty())
15271 if (!
m_taxi->loadTaxiDestinationsFromString(taxi_nodes,
GetTeam()))
15286 m_taxi->clearTaxiDestinations();
15289 m_taxi->setNodeAfterTeleport(taxi_currentNode);
15294 sLogger.info(
"Time for playerloading: {} ms",
static_cast<uint32_t>(timeToNow));
15316 if (!questProperties)
15326 questLogEntry->loadFromDB(fields);
15327 questLogEntry->updatePlayerFields();
15333#if VERSION_STRING >= TBC
15338 chance = floorf(chance) * 0.04f;
15362 float chance = 0.0f;
15365 if (level >
worldConfig.player.playerGeneratedInformationByLevelCap)
15366 level =
worldConfig.player.playerGeneratedInformationByLevelCap;
15373 float tmp = 100.0f * (baseCrit->val + agi * critPerAgi->val);
15374 tmp *= crit_to_dodge[playerClass];
15380 return std::max(chance, 0.0f);
15389 return std::max(chance, 0.0f);
15398 return std::max(chance, 0.0f);
15407 float defence_contribution = 0;
15414 tmp += defence_contribution;
15415 tmp = std::min(std::max(tmp, 0.0f), 95.0f);
15423 tmp += defence_contribution;
15424 tmp = std::min(std::max(tmp, 0.0f), 95.0f);
15438 tmp += defence_contribution;
15439 tmp = std::min(std::max(tmp, 0.0f), 95.0f);
15452 if (CritPerAgi ==
nullptr)
15457 float melee_bonus = 0;
15458 float ranged_bonus = 0;
15469 melee_bonus += itr->second.value;
15472 ranged_bonus += itr->second.value;
15485 if (SpellCritPerInt ==
nullptr)
15498#if VERSION_STRING != Classic
15499 for (
uint8_t school = 0; school < 7; ++school)
15514 speed = itemWeapon->getItemProperties()->Delay;
15519 if (offhandWeapon && offhandWeapon->getItemProperties()->Class ==
ITEM_CLASS_WEAPON)
15527 speed = rangedWeapon->getItemProperties()->Delay;
15538 int32_t rangedAttackPower = 0;
15548 switch (playerClass)
15552 attackPower = str * 2 - 20;
15554 rangedAttackPower = agi - 10;
15564 attackPower += agi + (lev * 2);
15569 attackPower += (lev * 3);
15575 attackPower = str + agi + (lev * 2) - 20;
15577 rangedAttackPower = lev + agi - 10;
15583 attackPower = str + agi + (lev * 2) - 20;
15585 rangedAttackPower = (lev * 2) + agi - 10;
15591 attackPower = str + agi + (lev * 2) - 20;
15593 rangedAttackPower = agi - 10;
15599 attackPower = (str * 2) + (lev * 3) - 20;
15601 rangedAttackPower = agi - 10;
15606#if VERSION_STRING >= WotLK
15609 attackPower = (str * 2) + (lev * 3) - 20;
15611 rangedAttackPower = lev + agi - 10;
15616 attackPower = agi - 10;
15622 if (rangedAttackPower < 0)
15623 rangedAttackPower = 0;
15625 if (attackPower < 0)
15632 if (levelInfo !=
nullptr)
15634 hpdelta = levelInfo->Stat[2] * 10;
15635 manadelta = levelInfo->Stat[3] * 15;
15639 if (levelInfo !=
nullptr)
15641 hpdelta -= levelInfo->Stat[2] * 10;
15642 manadelta -= levelInfo->Stat[3] * 15;
15647#if VERSION_STRING != Classic
15652 if (stat_bonus < 0)
15656 uint32_t res = hp + bonus + hpdelta;
15664 std::stringstream dmgLog;
15665 dmgLog <<
"has over " <<
worldConfig.limit.maxArenaPoints <<
" health " << res;
15669 if (
worldConfig.limit.broadcastMessageToGmOnExceeding)
15672 if (
worldConfig.limit.disconnectPlayerForExceedingLimits)
15690#
if VERSION_STRING > TBC
15697#if VERSION_STRING != Classic
15700 if (stat_bonus < 0)
15704 res = mana + bonus + manadelta;
15711 snprintf(logmsg, 256,
"has over %u mana (%i)",
worldConfig.limit.maxManaCap, res);
15714 if (
worldConfig.limit.broadcastMessageToGmOnExceeding)
15717 if (
worldConfig.limit.disconnectPlayerForExceedingLimits)
15745 if (block_multiplier < 1.0f)
15746 block_multiplier = 1.0f;
15749#if VERSION_STRING != Classic
15755#if VERSION_STRING != Classic
15761#if VERSION_STRING >= WotLK
15763 aurEff->getAura()->updateModifiers();
15765#if VERSION_STRING >= TBC
15767 aurEff->getAura()->updateModifiers();
15782 if (
object ==
nullptr)
15863#if VERSION_STRING >= WotLK
15867 auto modifiableAurEff = aurEff->getAura()->getModifiableAuraEffect(aurEff->getEffectIndex());
15868 aurEff->getAura()->SpellAuraModAttackPowerOfArmor(modifiableAurEff,
false);
15875#if VERSION_STRING > Classic
15881 if (
auto*
const pet =
getPet())
15882 pet->CalcResistance(type);
15884#if VERSION_STRING >= WotLK
15888 auto modifiableAurEff = aurEff->getAura()->getModifiableAuraEffect(aurEff->getEffectIndex());
15889 aurEff->getAura()->SpellAuraModAttackPowerOfArmor(modifiableAurEff,
true);
15911#if VERSION_STRING != Classic
15912 setPosStat(type, pos);
15915 setNegStat(type, -
neg);
15917 setNegStat(type,
neg);
15926 if (
auto*
const pet =
getPet())
15927 pet->CalcStat(type);
15934 const auto currentHealth =
getHealth();
15935 if (currentHealth == 0)
15939 if (currentHealth >= maxHealth)
15942 float_t amt = 0.0f;
15957 if (sendpending && mapid !=
m_mapId && force_new_world)
15960 bool sendpacket = (mapid ==
m_mapId);
15966 bool check =
false;
15968 if (!sendpacket || force_new_world)
15976 else if (
map->getBaseMap()->isInstanceMap())
15978 if (
auto state =
map->cannotEnter(
this))
16000 areaTrigger =
sMySQLStore.getMapGoBackTrigger(mapid);
16003 else if (instance_id && !
sInstanceMgr.getInstanceSave(instance_id))
16005 areaTrigger =
sMySQLStore.getMapEntranceTrigger(mapid);
16017 if (mapid != areaTrigger->
mapId)
16019 mapid = areaTrigger->
mapId;
16059 if (
const auto inventoryItem =
getItemInterface()->GetInventoryItem(slotIndex))
16064 applyItemMods(inventoryItem, slotIndex,
true,
false,
true);
16069 if (inventoryItem->isContainer() &&
getItemInterface()->IsBagSlot(slotIndex))
16071 for (
uint32_t containerSlot = 0; containerSlot < inventoryItem->getItemProperties()->ContainerSlots; ++containerSlot)
16073 if (
Item* item = (
static_cast<Container*
>(inventoryItem))->getItem(
static_cast<int16_t>(containerSlot)))
16092 applyItemMods(inventoryItem, slotIndex,
true,
false,
true);
16097 if (inventoryItem->isContainer() &&
getItemInterface()->IsBagSlot(slotIndex))
16099 for (
uint32_t containerSlot = 0; containerSlot < inventoryItem->getItemProperties()->ContainerSlots; ++containerSlot)
16101 if (
Item* item = (
static_cast<Container*
>(inventoryItem))->getItem(
static_cast<int16_t>(containerSlot)))
16118 if (inventoryItem->IsInWorld())
16123 inventoryItem->removeFromWorld();
16128 for (
uint32_t containerSlot = 0; containerSlot < inventoryItem->getItemProperties()->ContainerSlots; ++containerSlot)
16130 Item* item = (
static_cast<Container*
>(inventoryItem))->getItem(
static_cast<int16_t>(containerSlot));
16145 if (spellId == calledFrom)
16148 const auto spellSkillRange =
sSpellMgr.getSkillEntryRangeForSpell(spellId);
16149 for (
const auto& [_, skill_line_ability] : spellSkillRange)
16151 if (skill_line_ability->skilline == skillLine)
16159 if (
static_cast<int>(max) == -1)
16161 if (
static_cast<int>(current) != -1)
16179 if (combatRatingsEntry ==
nullptr)
16180 return float(rating);
16182 return (rating / combatRatingsEntry->
val);
16189 if (inRangeObject && inRangeObject->isPlayer())
16192 if (!group && group !=
getGroup())
16211 const auto spellInfo =
sSpellMgr.getSpellInfo(spellId);
16213 if (spellInfo !=
nullptr
16214 && (spellInfo->isPassive())
16217 if (spellInfo->getRequiredShapeShift())
16223 if (spellInfo->getCasterAuraState() != 0 && !
hasAuraState(
static_cast<AuraState>(spellInfo->getCasterAuraState()), spellInfo,
this))
16226 Spell* newSpell =
sSpellMgr.newSpell(
this, spellInfo,
true,
nullptr);
16238 auto aura =
sSpellMgr.newAura(sp, loginaura.dur,
this,
this,
false);
16239 for (
uint8_t x = 0; x < 3; x++)
16243 aura->addAuraEffect(
static_cast<AuraEffect>(sp->getEffectApplyAuraName(x)), sp->getEffectBasePoints(x) + 1, sp->getEffectMiscValue(x), 1.0f,
false, x);
16247 if (sp->getProcCharges() > 0 && loginaura.charges > 0)
16248 aura->setCharges(
static_cast<uint16_t>(loginaura.charges),
false);
16250 this->
addAura(std::move(aura));
16271 corpse->resetDeathClock();
16277#if VERSION_STRING > TBC
16280 logonspell->
prepare(&targets);
16301#if VERSION_STRING > TBC
16306 if (glyph_properties ==
nullptr)
16309 castSpell(
this, glyph_properties->SpellID,
true);
16345 uint8_t convert[] = { 1, 0, 3, 4, 2 };
16484#if VERSION_STRING >= Cata
16517#if VERSION_STRING > Classic
16541#if VERSION_STRING >= WotLK
16550 for (
uint8_t school = 1; school < 7; ++school)
16555#if VERSION_STRING > Classic
16573 if (aur !=
nullptr && aur->getTimeLeft() > 3000)
16575 for (
uint8_t i = 0; i < 3; ++i)
16590 if (charges > 0 && aur->getSpellId() != prevAura->getSpellId())
16592 ss << prevAura->getSpellId() <<
"," << prevAura->getTimeLeft() <<
"," << !prevAura->isNegative() <<
"," << charges <<
",";
16596 if (aur->getSpellInfo()->getProcCharges() == 0)
16597 ss << aur->getSpellId() <<
"," << aur->getTimeLeft() <<
"," << !aur->isNegative() <<
"," <<
uint32_t(0) <<
",";
16606 if (charges > 0 && prevAura)
16607 ss << prevAura->getSpellId() <<
"," << prevAura->getTimeLeft() <<
"," << !prevAura->isNegative() <<
"," << charges <<
",";
16622 float damageMod = 1;
16625 if (i->second.wclass == (
uint32_t)-1)
16626 damageMod += i->second.value;
16630 float averageFeralDamage;
16637 itemLeven = level - 1;
16638 else if (level < 46)
16640 else if (level < 49)
16641 itemLeven = 2 * level - 45;
16642 else if (level < 60)
16643 itemLeven = level + 4;
16648 if (itemLeven <= 28)
16649 averageFeralDamage = 1.563e-03f * itemLeven * itemLeven * itemLeven - 1.219e-01f * itemLeven * itemLeven + 3.802e+00f * itemLeven - 2.227e+01f;
16650 else if (itemLeven <= 41)
16651 averageFeralDamage = -3.817e-03f * itemLeven * itemLeven * itemLeven + 4.015e-01f * itemLeven * itemLeven - 1.289e+01f * itemLeven + 1.530e+02f;
16653 averageFeralDamage = 1.829e-04f * itemLeven * itemLeven * itemLeven - 2.692e-02f * itemLeven * itemLeven + 2.086e+00f * itemLeven - 1.645e+01f;
16655 rangeDamage = averageFeralDamage * 0.79f + deltaDone + attackPowerBonus * 1000.0f;
16656 rangeDamage *= damageMod;
16659 rangeDamage = averageFeralDamage * 1.21f + deltaDone + attackPowerBonus * 1000.0f;
16660 rangeDamage *= damageMod;
16668 itemLeven = level + 5;
16670 if (itemLeven > 70)
16674 if (itemLeven <= 30)
16675 averageFeralDamage = 7.638e-05f * itemLeven * itemLeven * itemLeven + 1.874e-03f * itemLeven * itemLeven + 4.967e-01f * itemLeven + 1.906e+00f;
16676 else if (itemLeven <= 44)
16677 averageFeralDamage = -1.412e-03f * itemLeven * itemLeven * itemLeven + 1.870e-01f * itemLeven * itemLeven - 7.046e+00f * itemLeven + 1.018e+02f;
16679 averageFeralDamage = 2.268e-04f * itemLeven * itemLeven * itemLeven - 3.704e-02f * itemLeven * itemLeven + 2.784e+00f * itemLeven - 3.616e+01f;
16681 averageFeralDamage *= 2.5f;
16683 rangeDamage = averageFeralDamage * 0.79f + deltaDone + attackPowerBonus * 2500.0f;
16684 rangeDamage *= damageMod;
16687 rangeDamage = averageFeralDamage * 1.21f + deltaDone + attackPowerBonus * 2500.0f;
16688 rangeDamage *= damageMod;
16702 float bonus = attackPowerBonus * speed;
16703 float damageMod = 1;
16704 for (std::map<uint32_t, WeaponModifier>::iterator weaponMod =
m_damageDone.begin(); weaponMod !=
m_damageDone.end(); ++weaponMod)
16706 if ((weaponMod->second.wclass == (
uint32_t)-1) ||
16708 damageMod += weaponMod->second.value;
16712 rangeDamage *= damageMod;
16716 rangeDamage *= damageMod;
16730#if VERSION_STRING != Classic
16745 bonus = attackPowerBonus * speed;
16750 if ((i->second.wclass == (
uint32_t)-1) ||
16753 damageMod += i->second.value;
16757 rangeDamage *= damageMod;
16761 rangeDamage *= damageMod;
16772#if VERSION_STRING != Classic
16782 for (std::map<uint32_t, WeaponModifier>::iterator weaponMod =
m_damageDone.begin(); weaponMod !=
m_damageDone.end(); ++weaponMod)
16784 if ((weaponMod->second.wclass == (
uint32_t)-1) ||
16787 damageMod += weaponMod->second.value;
16791#if VERSION_STRING < Cata
16812 rangeDamage *= damageMod;
16816 rangeDamage *= damageMod;
16828#if VERSION_STRING != Classic
16832 if (
auto*
const pet =
getPet())
16833 pet->calculateDamage();
16840 float attackPowerBonus;
16841 if (attackPowerOverride)
16842 attackPowerBonus = attackPowerOverride / 14000.0f;
16849 result = attackPowerBonus * 1000.0f;
16851 result = attackPowerBonus * 2500.0f;
16862 result = attackPowerBonus * speed;
16866#if VERSION_STRING > TBC
16867void Player::updateAchievementCriteria(AchievementCriteriaTypes type,
int32_t miscValue1 ,
int32_t miscValue2 ,
uint32_t miscValue3 ,
Unit* unit )
16869 m_achievementMgr->updateAchievementCriteria(type, miscValue1, miscValue2, miscValue3, unit);
16876 if (m_achievementMgr->isGroupCriteriaType(type))
16909 if (npcflagmask && !(creature->
getNpcFlags() & npcflagmask))
@ SPELL_AURA_PREVENT_RESURRECTION
@ SPELL_AURA_RETAIN_COMBO_POINTS
@ SPELL_AURA_MOD_ALL_WEAPON_SKILLS
@ SPELL_AURA_MOD_RANGED_ATTACK_POWER_BY_STAT_PCT
@ SPELL_AURA_PERIODIC_POWER_PCT
@ SPELL_AURA_MOD_SHAPESHIFT
@ SPELL_AURA_PERIODIC_HEAL_PCT
@ SPELL_AURA_MOD_POWER_REGEN
@ SPELL_AURA_ALLOW_TAME_PET_TYPE
@ SPELL_AURA_MOD_ATTACK_POWER_BY_STAT_PCT
@ SPELL_AURA_MOD_HEALTH_REGEN
@ SPELL_AURA_MOD_ATTACK_POWER_OF_ARMOR
@ SPELL_AURA_MOD_SKILL_TALENT
@ AURA_INTERRUPT_ON_ENTER_WATER
@ AURA_INTERRUPT_ON_MOVEMENT
@ AURA_INTERRUPT_ON_STAND_UP
@ AURA_INTERRUPT_ON_LEAVE_AREA
@ AURA_INTERRUPT_ON_TURNING
@ AURA_INTERRUPT_ON_LEAVE_WATER
std::vector< AsyncQueryResult > QueryResultVector
@ E_CHAR_LOGIN_NO_CHARACTER
#define CORPSE_RECLAIM_TIME_MS
@ CORPSE_FLAG_HIDDEN_CLOAK
@ CORPSE_FLAG_HIDDEN_HELM
@ CREATURE_FLAG1S_DEAD_INTERACT
@ RESTRICTION_CHECK_MOUNT_VENDOR
this checks for all possible values in table
#define CharacterDatabase
@ EVENT_PLAYER_DUEL_COUNTDOWN
@ EVENT_PLAYER_FORCED_RESURRECT
Zack 2007 05 28: similar to pet expire but we can have multiple guardians.
@ EVENT_PLAYER_EJECT_FROM_INSTANCE
@ EVENT_PLAYER_CHECKFORCHEATS
@ EVENT_PLAYER_SOFT_DISCONNECT
Zack 2007 06 08: After player not pushing release spirit for 6 minutes while dead.
@ EVENT_PLAYER_CHARM_ATTACK
@ EVENT_SEND_PACKET_TO_PLAYER_AFTER_LOGIN
@ EVENT_PLAYER_DUEL_BOUNDARY_CHECK
@ EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT
@ GROUP_UPDATE_FLAG_STATUS
@ INSTANCE_RESET_CHANGE_DIFFICULTY
@ CANNOT_ENTER_MAX_PLAYERS
@ CANNOT_ENTER_TOO_MANY_INSTANCES
@ CANNOT_ENTER_INSTANCE_BIND_MISMATCH
@ CANNOT_ENTER_DIFFICULTY_UNAVAILABLE
@ RAID_INSTANCE_WARNING_MIN
@ RAID_INSTANCE_WARNING_MIN_SOON
@ RAID_INSTANCE_WARNING_HOURS
@ INSTANCE_ABORT_ENCOUNTER
@ INSTANCE_ABORT_HEROIC_MODE_NOT_AVAILABLE
@ INSTANCE_ABORT_TOO_MANY
@ INSTANCE_ABORT_NOT_FOUND
@ INVENTORY_SLOT_ITEM_START
@ INVENTORY_SLOT_ITEM_END
@ EQUIPMENT_SLOT_MAINHAND
@ ITEM_MOD_HOLY_RESISTANCE
@ ITEM_MOD_HIT_AVOIDANCE_RATING
@ ITEM_MOD_MELEE_CRITICAL_AVOIDANCE_RATING
@ ITEM_MOD_NATURE_RESISTANCE
@ ITEM_MOD_SPELL_CRITICAL_AVOIDANCE_RATING
@ ITEM_MOD_SPELL_PENETRATION
@ ITEM_MOD_MELEE_HIT_RATING
@ ITEM_MOD_MELEE_HASTE_RATING
@ ITEM_MOD_RANGED_CRITICAL_STRIKE_RATING
@ ITEM_MOD_EXPERTISE_RATING
@ ITEM_MOD_SPELL_HIT_AVOIDANCE_RATING
@ ITEM_MOD_RANGED_ATTACK_POWER
@ ITEM_MOD_CRITICAL_STRIKE_RATING
@ ITEM_MOD_RANGED_HASTE_RATING
@ ITEM_MOD_CRITICAL_AVOIDANCE_RATING
@ ITEM_MOD_RANGED_HIT_AVOIDANCE_RATING
@ ITEM_MOD_FROST_RESISTANCE
@ ITEM_MOD_SHADOW_RESISTANCE
@ ITEM_MOD_MELEE_HIT_AVOIDANCE_RATING
@ ITEM_MOD_FIRE_RESISTANCE
@ ITEM_MOD_SPELL_CRITICAL_STRIKE_RATING
@ ITEM_MOD_SHIELD_BLOCK_RATING
@ ITEM_MOD_SPELL_HASTE_RATING
@ ITEM_MOD_RANGED_HIT_RATING
@ ITEM_MOD_FERAL_ATTACK_POWER
@ ITEM_MOD_ARMOR_PENETRATION_RATING
@ ITEM_MOD_SPELL_HEALING_DONE
@ ITEM_MOD_WEAPON_SKILL_RATING
@ ITEM_MOD_DEFENSE_RATING
@ ITEM_MOD_ARCANE_RESISTANCE
@ ITEM_MOD_SPELL_HIT_RATING
@ ITEM_MOD_MANA_REGENERATION
@ ITEM_MOD_RESILIENCE_RATING
@ ITEM_MOD_MELEE_CRITICAL_STRIKE_RATING
@ ITEM_MOD_RANGED_CRITICAL_AVOIDANCE_RATING
@ ITEM_MOD_SPELL_DAMAGE_DONE
#define VOID_STORAGE_MAX_SLOT
@ INVENTORY_SLOT_BAG_START
@ VOID_TRANSFER_ERROR_FULL
@ VOID_TRANSFER_ERROR_INTERNAL_ERROR_1
@ MAX_INSPECTED_ENCHANTMENT_SLOT
@ REFORGE_ENCHANTMENT_SLOT
#define INVENTORY_SLOT_NOT_SET
#define INVENTORY_KEYRING_END
#define CURRENCYTOKEN_SLOT_START
#define CURRENCYTOKEN_SLOT_END
#define MAX_ITEM_PROTO_DAMAGES
#define MAX_ITEM_PROTO_SPELLS
#define MAX_ITEM_PROTO_STATS
#define sLogonCommHandler
@ LOOT_SLOT_TYPE_ROLL_ONGOING
@ LOOT_SLOT_TYPE_ALLOW_LOOT
std::set< uint32_t > LooterSet
@ PARTY_LOOT_MASTER_LOOTER
@ PARTY_LOOT_NEED_BEFORE_GREED
@ PARTY_LOOT_FREE_FOR_ALL
std::map< uint32_t, std::unique_ptr< PersonaltemList > > PersonaltemMap
@ CURRENT_CHANNELED_SPELL
@ CURRENT_AUTOREPEAT_SPELL
@ SMSG_LOAD_EQUIPMENT_SET
@ SMSG_FORCE_TURN_RATE_CHANGE
@ MSG_MOVE_SET_SWIM_BACK_SPEED
@ SMSG_BATTLE_PET_JOURNAL_LOCK_ACQUIRED
@ SMSG_FORCE_WALK_SPEED_CHANGE
@ SMSG_FORCE_FLIGHT_BACK_SPEED_CHANGE
@ SMSG_RAID_INSTANCE_MESSAGE
@ MSG_MOVE_SET_PITCH_RATE
@ SMSG_MOVE_UPDATE_TELEPORT
@ SMSG_INITIALIZE_FACTIONS
@ SMSG_FORCE_RUN_SPEED_CHANGE
@ SMSG_FORCE_SWIM_BACK_SPEED_CHANGE
@ SMSG_FORCE_RUN_BACK_SPEED_CHANGE
@ SMSG_SET_FORCED_REACTIONS
@ SMSG_FORCE_FLIGHT_SPEED_CHANGE
@ SMSG_BATTLE_PET_JOURNAL
@ SMSG_FORCE_SWIM_SPEED_CHANGE
@ SMSG_RAID_INSTANCE_INFO
@ SMSG_COMPRESSED_UPDATE_OBJECT
@ SMSG_UPDATE_INSTANCE_OWNERSHIP
@ SMSG_INSTANCE_RESET_FAILED
@ SMSG_UPDATE_COMBO_POINTS
@ MSG_MOVE_SET_FLIGHT_SPEED
@ MSG_MOVE_SET_WALK_SPEED
@ SMSG_EQUIPMENT_SET_SAVED
@ MSG_MOVE_SET_SWIM_SPEED
@ SMSG_UPDATE_ACTION_BUTTONS
@ MSG_MOVE_SET_FLIGHT_BACK_SPEED
@ SMSG_CANCEL_AUTO_REPEAT
@ SMSG_MOVE_SET_ACTIVE_MOVER
@ SMSG_RESET_FAILED_NOTIFY
@ SMSG_UPDATE_LAST_INSTANCE
@ SMSG_FORCE_PITCH_RATE_CHANGE
@ SMSG_UPDATE_TALENT_DATA
@ SMSG_EQUIPMENT_SET_LIST
@ SMSG_INSTANCE_SAVE_CREATED
@ MSG_MOVE_SET_RUN_BACK_SPEED
@ PET_WATER_ELEMENTAL_NEW
@ PET_SPELL_STATE_DEFAULT
@ PET_SLOT_LAST_STABLE_SLOT
@ PET_SLOT_FIRST_STABLE_SLOT
@ PET_SLOT_MAX_ACTIVE_SLOT
@ PET_SLOT_FIRST_ACTIVE_SLOT
const time_t forcedResurrectInterval
std::map< uint8_t, std::unique_ptr< PetCache > > PetCacheMap
@ PLAYER_MISC_FLAG_SHOW_RELEASE_TIME
@ PLAYER_FLAG_DEATH_WORLD_ENABLE
@ PLAYER_FLAG_PARTY_LEADER
@ PLAYER_FLAG_PVP_GUARD_ATTACKABLE
@ UNDERWATERSTATE_SWIMMING
@ UNDERWATERSTATE_UNDERWATER
std::unordered_set< uint32_t > SpellSet
@ FACTION_FLAG_FORCED_INVISIBLE
@ FACTION_FLAG_DISABLE_ATWAR
@ PLAYER_CHEAT_AURA_STACK
@ PLAYER_CHEAT_ITEM_STACK
@ PLAYER_CHEAT_TRIGGERPASS
static uint8_t getSideByRace(uint8_t race)
@ CR_RESILIENCE_PLAYER_DAMAGE_TAKEN
@ CR_WEAPON_SKILL_OFFHAND
@ CR_WEAPON_SKILL_MAINHAND
@ CR_RESILIENCE_CRIT_TAKEN
@ FRIEND_IGNORE_NOT_FOUND
@ DUEL_STATUS_OUTOFBOUNDS
#define COOLDOWN_SKIP_SAVE_IF_MS_LESS_THAN
#define LOGIN_CIENT_SEND_DELAY
#define DBC_PLAYER_SKILL_MAX
#define PLAYER_ACTION_BUTTON_COUNT
#define PLAYER_ACTION_BUTTON_SIZE
#define DBC_PLAYER_LEVEL_CAP
#define BASE_PARRY_CHANCE
#define PLAYER_HONORLESS_TARGET_SPELL
#define BASE_BLOCK_CHANCE
#define COLLISION_INDOOR_CHECK_INTERVAL
bool RankChanged(int32_t Standing, int32_t Change)
bool CanToggleAtWar(uint8_t flag)
bool Visible(uint8_t flag)
bool RankChangedFlat(int32_t Standing, int32_t NewStanding)
bool ForcedInvisible(uint8_t flag)
bool SetFlagAtWar(uint8_t &flag, bool set)
bool Inactive(uint8_t flag)
bool Hidden(uint8_t flag)
bool SetFlagVisible(uint8_t &flag, bool set)
bool SetFlagInactive(uint8_t &flag, bool set)
@ TOTAL_PLAYER_POWER_TYPES
@ EXTRA_PROC_ON_MAIN_HAND_HIT_ONLY
@ EXTRA_PROC_ON_OFF_HAND_HIT_ONLY
@ PROC_ON_DONE_RANGED_HIT
@ PROC_ON_DONE_OFFHAND_ATTACK
@ PROC_ON_DONE_MELEE_SPELL_HIT
@ PROC_ON_DONE_RANGED_SPELL_HIT
@ INVALID_REASON_HAVE_TIMED_QUEST
#define MAX_QUEST_LOG_SIZE
#define MAX_REQUIRED_QUEST_ITEM
@ SKILL_LANG_PANDAREN_NEUTRAL
@ SKILL_LANG_PANDAREN_ALLIANCE
@ SKILL_LANG_DEMON_TONGUE
@ SKILL_LANG_PANDAREN_HORDE
@ ATTRIBUTESEXB_NOT_NEED_SHAPESHIFT
@ ATTRIBUTESEX_AUTOCASTED_AT_SPELL_LEARN
@ ATTRIBUTESEX_NO_INITIAL_AGGRO
@ ATTRIBUTES_TRIGGER_COOLDOWN
@ ATTRIBUTES_ONLY_OUTDOORS
@ SPELL_EFFECT_ADD_FARSIGHT
@ SPELL_EFFECT_APPLY_GROUP_AREA_AURA
@ SPELL_EFFECT_PROFICIENCY
@ SPELL_EFFECT_TRIGGER_SPELL
@ SPELL_EFFECT_DUAL_WIELD_2H
@ SPELL_EFFECT_TRADE_SKILL
@ SPELL_EFFECT_PERSISTENT_AREA_AURA
@ SPELL_EFFECT_DUAL_WIELD
@ SPELL_EFFECT_APPLY_RAID_AREA_AURA
@ SPELL_EFFECT_LEARN_SPELL
@ SPELL_EFFECT_APPLY_AURA
@ SPELL_FAILED_SPELL_UNAVAILABLE
@ SPELL_FLAG_IS_EXPIREING_ON_PET
@ SPELL_FLAG_IS_CASTED_ON_PET_SUMMON_PET_OWNER
@ SPELL_FLAG_IS_CASTED_ON_PET_SUMMON_ON_PET
@ SPELL_FLAG_IS_EXPIREING_WITH_PET
std::pair< SpellAreaMap::const_iterator, SpellAreaMap::const_iterator > SpellAreaMapBounds
std::pair< SpellAreaForAreaMap::const_iterator, SpellAreaForAreaMap::const_iterator > SpellAreaForAreaMapBounds
std::pair< SpellAreaForQuestMap::const_iterator, SpellAreaForQuestMap::const_iterator > SpellAreaForQuestMapBounds
@ SPELLMOD_COOLDOWN_DECREASE
@ SPELLMOD_GLOBAL_COOLDOWN
int ZEXPORT deflateEnd(z_streamp strm)
int ZEXPORT deflate(z_streamp strm, int flush)
#define deflateInit(strm, level)
#define sTransportHandler
@ UNIT_FLAG2_ENABLE_POWER_REGEN
@ POS_AURA_LIMIT_PVP_ATTACKABLE
@ UNIT_FLAG_PVP_ATTACKABLE
@ U_DYN_FLAG_TAPPED_BY_PLAYER
@ REGENERATION_INTERVAL_HOLY_POWER
#define getOffsetForStructuredField(s, m)
#define getOffsetForStructuredArrayField(s, m, index)
#define getSizeOfStructure(s)
static constexpr uint8_t MAX_SPELL_EFFECTS
SERVER_DECL WDB::WDBContainer< WDB::Structures::CreatureDisplayInfoExtraEntry > sCreatureDisplayInfoExtraStore
SERVER_DECL WDB::WDBContainer< WDB::Structures::TalentEntry > sTalentStore
WDB::Structures::MapDifficulty const * getMapDifficultyData(uint32_t mapId, InstanceDifficulty::Difficulties difficulty)
SERVER_DECL WDB::WDBContainer< WDB::Structures::ChrRacesEntry > sChrRacesStore
SERVER_DECL WDB::WDBContainer< WDB::Structures::GtChanceToMeleeCritEntry > sGtChanceToMeleeCritStore
SERVER_DECL WDB::WDBContainer< WDB::Structures::GlyphPropertiesEntry > sGlyphPropertiesStore
SERVER_DECL WDB::WDBContainer< WDB::Structures::SummonPropertiesEntry > sSummonPropertiesStore
SERVER_DECL WDB::WDBContainer< WDB::Structures::MapEntry > sMapStore
SERVER_DECL WDB::WDBContainer< WDB::Structures::SkillLineEntry > sSkillLineStore
TaxiPathNodesByPath sTaxiPathNodesByPath
SERVER_DECL WDB::WDBContainer< WDB::Structures::ItemSetEntry > sItemSetStore
SERVER_DECL WDB::WDBContainer< WDB::Structures::GtChanceToMeleeCritBaseEntry > sGtChanceToMeleeCritBaseStore
SERVER_DECL WDB::WDBContainer< WDB::Structures::CurrencyTypesEntry > sCurrencyTypesStore
SERVER_DECL WDB::WDBContainer< WDB::Structures::ItemEntry > sItemStore
SERVER_DECL WDB::WDBContainer< WDB::Structures::TaxiPathEntry > sTaxiPathStore
SERVER_DECL WDB::WDBContainer< WDB::Structures::GtCombatRatingsEntry > sGtCombatRatingsStore
SERVER_DECL WDB::WDBContainer< WDB::Structures::CreatureDisplayInfoEntry > sCreatureDisplayInfoStore
SERVER_DECL WDB::WDBContainer< WDB::Structures::PhaseEntry > sPhaseStore
SERVER_DECL WDB::WDBContainer< WDB::Structures::CreatureModelDataEntry > sCreatureModelDataStore
SERVER_DECL WDB::WDBContainer< WDB::Structures::ChrClassesEntry > sChrClassesStore
SERVER_DECL WDB::WDBContainer< WDB::Structures::GtChanceToSpellCritBaseEntry > sGtChanceToSpellCritBaseStore
SERVER_DECL WDB::WDBContainer< WDB::Structures::FactionEntry > sFactionStore
SERVER_DECL WDB::WDBContainer< WDB::Structures::ScalingStatValuesEntry > sScalingStatValuesStore
SERVER_DECL WDB::WDBContainer< WDB::Structures::ChatChannelsEntry > sChatChannelsStore
SERVER_DECL WDB::WDBContainer< WDB::Structures::GtChanceToSpellCritEntry > sGtChanceToSpellCritStore
SERVER_DECL WDB::WDBContainer< WDB::Structures::WorldMapOverlayEntry > sWorldMapOverlayStore
SERVER_DECL WDB::WDBContainer< WDB::Structures::NumTalentsAtLevel > sNumTalentsAtLevel
SERVER_DECL WDB::WDBContainer< WDB::Structures::SpellShapeshiftFormEntry > sSpellShapeshiftFormStore
SERVER_DECL WDB::WDBContainer< WDB::Structures::WorldMapAreaEntry > sWorldMapAreaStore
WDB::Structures::MapDifficulty const * getDownscaledMapDifficultyData(uint32_t mapId, InstanceDifficulty::Difficulties &difficulty)
SERVER_DECL WDB::WDBContainer< WDB::Structures::GlyphSlotEntry > sGlyphSlotStore
SERVER_DECL WDB::WDBContainer< WDB::Structures::TaxiNodesEntry > sTaxiNodesStore
SERVER_DECL WDB::WDBContainer< WDB::Structures::TalentTabEntry > sTalentTabStore
WDB::Structures::CharStartOutfitEntry const * getStartOutfitByRaceClass(uint8_t race, uint8_t class_, uint8_t gender)
SERVER_DECL WDB::WDBContainer< WDB::Structures::ScalingStatDistributionEntry > sScalingStatDistributionStore
std::vector< WDB::Structures::TaxiPathNodeEntry const * > TaxiPathNodeList
static constexpr uint8_t WOWPLAYER_EXPLORED_ZONES_COUNT
static constexpr uint8_t WOWPLAYER_SKILL_INFO_COUNT
static void FastGUIDPack(ByteBuffer &buf, const uint64_t &oldguid)
static const unsigned char map[256]
bool hideWayPoints(Player *player)
void eventOnTargetDied(Object *pKiller)
we have to tell our current enemies to stop attacking us, we should also forget about our targets
bool SavetoDB(QueryBuffer *buf)
void FillEquipmentSetListPacket(WorldPacket &data)
bool LoadfromDB(QueryResult *result)
virtual std::unique_ptr< WorldPacket > serialise()
void removeAura(AuraRemoveMode mode=AURA_REMOVE_BY_SERVER)
uint32_t getMapId() const
bool isInstanceableMap() const
bool isBattlegroundOrArena() const
Battleground * getBattleground()
virtual bool CreateCorpse(Player *plr)
virtual void OnAddPlayer(Player *plr)=0
void portPlayer(Player *plr, bool skip_teleport=false)
virtual bool HookHandleRepop(Player *plr)=0
virtual void HookOnPlayerDeath(Player *plr)=0
virtual void HookOnUnitDied(Unit *victim)
void removePlayer(Player *plr, bool logout)
void removePendingPlayer(Player *plr)
virtual void HookOnPlayerResurrect(Player *player)
void onPlayerPushed(Player *plr)
void put(size_t pos, T value)
void writeBits(T value, size_t bits)
void PutBits(size_t pos, T value, uint32_t bitCount)
void WriteByteSeq(uint8_t b)
bool writeBit(uint32_t bit)
void attemptJoin(Player *plr, std::string password, bool skipCheck=false)
bool hasMember(Player *pPlayer) const
void leaveChannel(Player *plr, bool sendPacket=true)
uint8_t getCharterType() const
Item * getItem(int16_t slot)
virtual void onQuestAccept(Player *, QuestProperties const *)
CreatureAIScript * GetScript()
bool HasQuest(uint32_t id, uint32_t type)
CreatureProperties const * GetCreatureProperties()
bool isQuestGiver() const
void event_RemoveEvents()
uint8_t asUint8(bool _silencedError=false) const
uint64_t asUint64(bool _silencedError=false) const
const char * asCString() const
uint16_t asUint16(bool _silencedError=false) const
uint32_t asUint32(bool _silencedError=false) const
uint16_t getLootMode() const
void getFishLoot(Player *loot_owner, bool getJunk=false)
uint32_t getLootGenerationTime() const
void setLootGenerationTime()
uint32_t getRespawnDelay() const
LootState getLootState() const
uint64_t getCreatedByGuid() const
time_t getRespawnTime() const
bool isSpawnedByDefault() const
void RemoveFromWorld(bool free_guid)
Remove object from world.
void despawn(uint32_t delay, uint32_t forceRespawntime)
GameObjectProperties const * GetGameObjectProperties() const
void setLootState(LootState state, Unit *unit=nullptr)
void SendPacketToAll(WorldPacket *packet)
CachedCharacterInfo * GetLeader(void)
void UpdateAllOutOfRangePlayersFor(Player *pPlayer)
void UpdateOutOfRangePlayer(Player *pPlayer, bool Distribute, WorldPacket *Packet)
void sendGroupLoot(Loot *loot, Object *object, Player *plr, uint32_t mapId)
void RemovePlayer(CachedCharacterInfo *info)
std::string const & getMOTD() const
static int32_t CalculateHonorPointsForKill(uint32_t playerLevel, uint32_t victimLevel)
static void RecalculateHonorFields(Player *pPlayer)
uint32_t getMapId() const
bool removePlayer(Player *player)
uint32_t getInstanceId() const
virtual void OnZoneChange(Player *, uint32_t, uint32_t)
virtual void OnPlayerDeath(Player *, Unit *)
virtual void OnPlayerEnter(Player *)
uint32_t GetItemCount(uint32_t itemid, bool IncBank=false)
Finds item ammount on inventory, banks not included.
Item * SafeAddItem(uint32_t ItemId, int8_t ContainerSlot, int16_t slot)
Creates and adds a item that can be manipulated after.
Item * GetInventoryItem(int16_t slot)
Gets a item from Inventory.
void mLoadItemsFromDatabase(QueryResult *result)
Item Loading.
std::unique_ptr< Item > SafeRemoveAndRetreiveItemFromSlot(int8_t ContainerSlot, int16_t slot, bool destroy)
Removes the item safely and returns it back for usage.
bool AddItemById(uint32_t itemid, uint32_t count, int32_t randomprop)
Arcemu::EquipmentSetMgr m_EquipmentSets
SlotResult FindFreeInventorySlot(ItemProperties const *proto)
void HandleItemDurations()
Look for items with limited duration and send the remaining time to the client.
void buildInventoryChangeError(Item const *srcItem, Item const *dstItem, uint8_t inventoryError, uint32_t srcItemId=0)
uint32_t m_CreateForPlayer(ByteBuffer *data)
void sendEnchantDurations(Item const *forItem=nullptr)
void mSaveItemsToDatabase(bool first, QueryBuffer *buf)
Item saving.
bool IsEquipped(uint32_t itemid)
Item * GetItemByGUID(uint64_t itemGuid)
Gets a Item by guid.
void addTradeableItem(Item *item)
void update(uint32_t timePassed)
Item * FindItemLessMax(uint32_t itemid, uint32_t cnt, bool IncBank)
Checks for stacks that didn't reached max capacity.
int8_t GetItemSlotByType(uint32_t type)
std::tuple< AddItemResult, std::unique_ptr< Item > > AddItemToFreeSlot(std::unique_ptr< Item > item)
Adds a Item to a free slot.
void applyAllEnchantmentBonuses()
void removeEnchantment(EnchantmentSlot slot, bool timerExpired=false)
uint32_t getDurability() const
static uint32_t generateRandomSuffixFactor(ItemProperties const *m_itemProto)
void removeAllEnchantments(bool onlyTemporary)
uint32_t getMaxDurability() const
void setStackCount(uint32_t count)
ItemProperties const * getItemProperties() const
int32_t getReforgableStat(ItemModType statType) const
uint32_t getVisibleEntry() const
uint32_t getEnchantmentId(uint8_t index) const
void removeAllEnchantmentBonuses()
std::unique_ptr< Loot > m_loot
void applyRandomProperties(bool apply)
uint8_t getSocketSlotCount(bool includePrismatic=true) const
EnchantmentInstance * getEnchantment(EnchantmentSlot slot)
void ChangeCoords(const LocationVector &src)
float distanceSquare(const LocationVector &comp) const
static WDB::Structures::AreaTableEntry const * GetAreaById(uint32_t area_id)
WDB::Structures::FactionEntry const * m_factionEntry
bool isValidTarget(Object *target, SpellInfo const *bySpell=nullptr)
Creature * getWorldMapCreature(const uint64_t &guid) const
void BuildFieldUpdatePacket(Player *Target, uint32_t Index, uint32_t Value)
void setScale(float scaleX)
float GetTransOffsetY() const
LocationVector GetPosition() const
float CalcDistance(Object *Ob)
virtual void setCreateBits(UpdateMask *updateMask, Player *target) const
const uint32_t & getAreaId() const
void SetInstanceID(int32_t instance)
const float & GetOrientation() const
bool IsWithinDistInMap(Object *obj, const float dist2compare) const
void removeDynamicFlags(uint16_t dynamicFlags)
void interruptSpell(uint32_t spellId=0, bool checkMeleeSpell=true)
virtual void setUpdateBits(UpdateMask *updateMask, Player *target) const
float GetTransOffsetX() const
MovementInfo obj_movement_info
bool isHostileTo(Object *target)
LocationVector m_position
void setZoneId(uint32_t newZone)
Unit * getWorldMapUnit(const uint64_t &guid) const
bool isInFront(Object *target)
virtual uint32_t buildCreateUpdateBlockForPlayer(ByteBuffer *data, Player *target)
This includes any nested objects we have, inventory for example.
void setGuidLow(uint32_t low)
std::vector< Object * > getInRangeObjectsSet() const
void setDynamicFlags(uint16_t dynamicFlags)
::WDB::Structures::AreaTableEntry const * GetArea() const
Transporter * GetTransport() const
std::vector< Object * > getInRangePlayersSet() const
bool isCastingSpell(bool skipChanneled=false, bool skipAutorepeat=false, bool isAutoshoot=false) const
float calcRadAngle(float Position1X, float Position1Y, float Position2X, float Position2Y)
void setObjectType(uint8_t objectTypeId)
uint32_t GetMapId() const
const float & GetPositionX() const
Player * getWorldMapPlayer(const uint64_t &guid) const
void setGuid(uint64_t guid)
virtual bool isTransporter() const
bool write(const uint8_t &member, uint8_t val, bool skipObjectUpdate=false)
uint32_t * m_uint32Values
WorldMap * getWorldMap() const
GameObject * ToGameObject()
const float & GetPositionZ() const
bool isGameObject() const
void interruptSpellWithSpellType(CurrentSpellType spellType)
const WoWGuid & GetNewGUID() const
float GetTransOffsetZ() const
virtual bool isPet() const
float GetTransOffsetO() const
uint8_t getObjectTypeId() const
bool isObjectInInRangeOppositeFactionSet(Object *pObj) const
uint32_t GetPhase() const
bool isCreatureOrPlayer() const
virtual void AddToWorld()
virtual void RemoveFromWorld(bool free_guid)
Remove object from world.
uint32_t getGuidLow() const
uint32_t getEntry() const
bool SetPosition(float newX, float newY, float newZ, float newOrientation, bool allowPorting=false)
float getDistance(Object const *obj) const
Spell * getCurrentSpell(CurrentSpellType spellType) const
const WoWObject * objectData() const
const uint32_t & getZoneId() const
void addInRangeOppositeFaction(Object *obj)
void SetMapId(uint32_t newMap)
float getExactDistSq(float x, float y, float z) const
uint16_t getDynamicFlags() const
const float & GetPositionY() const
void SendTalentsToOwner()
void unSummonTemporarily()
ActionButton & getActionButton(uint8_t slot)
void addTalent(uint32_t talentId, uint8_t rankId)
uint32_t getTalentPoints() const
void setTalentPoints(uint32_t points)
std::map< uint32_t, uint8_t > const & getTalents() const
uint32_t getLoginFlag() const
CachedCharacterInfo * getPlayerInfo() const
std::set< uint32_t > getFinishedQuests() const
static Standing getReputationRankFromStanding(int32_t value)
void setPlayerFlags(uint32_t flags)
uint32_t getBuybackPriceSlot(uint8_t slot) const
void setInventorySlotItemGuid(uint8_t slot, uint64_t guid)
uint32_t getLevelGrouping()
void setQuestLogExpireTimeBySlot(uint8_t slot, uint32_t expireTime)
void calculateDamage() override
uint32_t getCombatRating(uint8_t combatRating) const
uint32_t getNextLevelXp() const
uint32_t getGlyphsEnabled() const
uint8_t getPvpRank() const
void initialiseArenaTeam()
void setModDamageDoneNegative(uint16_t school, uint32_t value)
float getRangedCritPercentage() const
void leftChannel(Channel *channel)
void clearCooldownForSpell(uint32_t spellId)
bool canDualWield2H() const
uint32_t m_flatStatModPos[5]
float getSpellCritPercentage(uint8_t school) const
int32_t getBaseFactionStanding(uint32_t faction)
void setTeam(uint32_t team)
uint32_t getQueuedBgInstanceId() const
uint32_t m_underwaterMaxTime
void repopAtGraveyard(float ox, float oy, float oz, uint32_t mapId)
bool checkInstanceCount(uint32_t instanceId) const
void modOffHandExpertise(int32_t value)
void setResurrectMapId(uint32_t id)
std::list< ItemSet > m_itemSets
uint8_t getHairColor() const
void setGuildTimestamp(uint32_t timestamp)
void unSummonPetTemporarily()
void setQuestLogEntryBySlot(uint8_t slot, uint32_t questEntry)
bool m_isWaterBreathingEnabled
void sendSpellCooldownEventPacket(uint32_t spellId)
WDB::Structures::ChrClassesEntry const * getDbcClassEntry()
void _verifySkillValues(WDB::Structures::SkillLineEntry const *skillEntry, uint16_t *currentValue, uint16_t *maxValue, uint16_t *skillStep, bool *requireUpdate)
void eventPortToGm(Player *gmPlayer)
uint64_t getFarsightGuid() const
uint32_t getModDamageDonePositive(uint16_t school) const
void setHairColor(uint8_t color)
uint8_t getPetCount() const
uint16_t getSkillLineCurrent(uint16_t skillLine, bool includeBonus=true) const
void setManaRegenerationWhileCasting(float value)
void outPacket(uint16_t opcode, uint16_t length, const void *data) override
void sendRaidDifficultyPacket()
void onTalkReputation(WDB::Structures::FactionEntry const *factionEntry)
uint32_t getTeleportState() const
std::set< uint32_t > m_finishedDailies
void zoneUpdate(uint32_t zoneId)
float getOffHandCritPercentage() const
TradeData * getTradeData() const
void sendPacket(WorldPacket *packet) override
ItemInterface * getItemInterface() const
float getMeleeCritPercentage() const
bool loadSpells(QueryResult *result)
void disableAppearing(bool disable)
void setTrackCreature(uint32_t id)
float_t calculateHealthRegenerationValue(bool inCombat) const
void sendInitialWorldstates()
void setFace(uint8_t face)
void sendDestroyObjectPacket(uint64_t destroyedGuid)
void sendUpdateDataToSet(ByteBuffer *groupBuf, ByteBuffer *nonGroupBuf, bool sendToSelf)
void addAuraVision(uint8_t auraVision)
void applyReforgeEnchantment(Item *item, bool apply)
uint16_t m_foodDrinkSpellVisualTimer
uint64_t getDuelArbiter() const
virtual bool isClassMage() const
void removeTempItemEnchantsOnArena()
SpellSet m_shapeshiftSpells
void setEnteringToWorld()
bool loadFromDB(uint32_t guid)
void setRestState(uint8_t state)
void addTalentPoints(uint32_t talentPoints, bool forBothSpecs=true)
std::optional< uint8_t > findFreeActivePetSlot() const
uint32_t checkDamageLimits(uint32_t damage, uint32_t spellId)
float getBlockPercentage() const
bool hasSkillLine(uint16_t skillLine, bool strict=false) const
uint32_t getMountVehicleId() const
void modExpertise(int32_t value)
uint32_t getGuildLevel() const
void setVendorBuybackSlot(uint8_t slot, uint64_t guid)
Player * getDuelPlayer() const
uint16_t getSkillInfoId(uint32_t index, uint8_t offset) const
uint32_t m_classicMaxLevel
void removePetCache(uint8_t petId)
void _addCooldown(uint32_t type, uint32_t mis, uint32_t time, uint32_t SpellId, uint32_t ItemId)
void setDuelTeam(uint32_t team)
uint64_t getComboPointTarget() const
uint32_t getTrackResource() const
uint16_t getSkillInfoCurrentValue(uint32_t index, uint8_t offset) const
void sendEquipmentSetList()
bool m_isCorpseCreationAllowed
void removeQuestMob(uint32_t entry)
bool isFriended(uint32_t guid) const
void addSummonSpell(uint32_t entry, uint32_t spellId)
void modModTargetPhysicalResistance(int32_t value)
void setChampioningFaction(uint32_t factionId)
void setTalentPointsFromQuests(uint32_t talentPoints)
void setDualWield2H(bool enable)
std::set< uint32_t > quest_spells
uint32_t getModTargetPhysicalResistance() const
void requestDuel(Player *target)
void sendPetTameFailure(uint8_t result) const
float getDodgePercentage() const
LocationVector getLastGroupPosition() const
uint32_t getLifetimeHonorableKills() const
uint32_t getTrackCreature() const
uint32_t getExaltedCount()
void handleAuraInterruptForMovementFlags(MovementInfo const &movement_info)
uint8_t getBankSlots() const
std::list< std::unique_ptr< Item > > m_GarbageItems
uint32_t m_inviteArenaTeamId
void sendMoveSetSpeedPaket(UnitSpeedType speed_type, float speed)
PetCache const * getPetCache(uint8_t petId) const
void setResurrectPosition(LocationVector position)
void sendFriendStatus(bool comesOnline)
uint32_t getPlayerFieldBytes() const
void addGlobalCooldown(SpellInfo const *spellInfo, Spell *castingSpell, const bool sendPacket=false)
void initialiseReputation()
void setMountSpellId(uint32_t id)
void addCalculatedRestXp(uint32_t seconds)
void setBankSlotItemGuid(uint8_t slot, uint64_t guid)
void addQuestMob(uint32_t entry)
uint32_t getHonorToday() const
int32_t getCorpseInstanceId() const
BGEntryData m_bgEntryData
static void initVisibleUpdateBits()
Creature * getCreatureWhenICanInteract(WoWGuid const &guid, uint32_t npcflagmask)
uint32_t m_timeSyncCounter
static void changeLooks(uint64_t guid, uint8_t gender, uint8_t skin, uint8_t face, uint8_t hairStyle, uint8_t hairColor, uint8_t facialHair)
void _updateSkillFieldOnValueChange(const PlayerSkillFieldPosition fieldPosition, uint16_t skillStep, uint16_t currentValue, uint16_t maxValue)
uint16_t getSkillInfoBonusTemporary(uint32_t index, uint8_t offset) const
void saveAuras(std::stringstream &)
float getManaRegeneration() const
void addHonor(uint32_t honorPoints, bool sendUpdate)
std::mutex m_mutexChannel
uint32_t getBlockDamageReduction()
uint32_t calcTalentResetCost(uint32_t resetnum) const
WDB::Structures::ChrRacesEntry const * getDbcRaceEntry()
void setFallDisabledUntil(time_t time)
uint8_t getDuelStatus() const
void setInitialDisplayIds(uint8_t gender, uint8_t race)
void setRoles(uint8_t role)
void removePvpFlag() override
void setPlayerInfoIfNeeded()
std::map< uint32_t, WeaponModifier > m_damageDone
void sendInitialLogonPackets()
void setBattleground(Battleground *bg)
uint32_t getInitialFactionId()
float getParryPercentage() const
void sendEmptyPetSpellList()
uint64_t getCoinage() const
void updateInrangeSetsBasedOnReputation()
uint32_t getKillsLifetime() const
void updatePotionCooldown()
LevelInfo const * m_levelInfo
void sendPlayObjectSoundPacket(uint64_t objectGuid, uint32_t soundId)
uint32_t m_timeSyncServer
void disableSummoning(bool disable)
uint64_t getAreaSpiritHealerGuid() const
void sendPoiById(uint32_t id)
Unit * getUnitOwner() override
uint32_t getResistanceBuffModNegative(uint8_t type) const
uint32_t getFreePrimaryProfessionPoints() const
InstanceTimeMap m_instanceResetTimes
void setDrunkValue(uint8_t value)
void addQuestKill(uint32_t questId, uint8_t reqId, uint32_t delay=0)
bool m_FirstCastAutoRepeat
void removeItemsFromWorld()
uint8_t getStableSlotCount() const
bool hasQuestInFinishedDailies(uint32_t questId) const
void sendSetProficiencyPacket(uint8_t itemClass, uint32_t proficiency)
void addArenaPoints(uint32_t arenaPoints, bool sendUpdate)
std::set< uint64_t > m_visibleObjects
uint16_t getSkillInfoStep(uint32_t index, uint8_t offset) const
void setSkillInfoCurrentValue(uint32_t index, uint8_t offset, uint16_t current)
uint32_t weaponProficiency
void loadBoundInstances()
uint32_t getPlayerBytes3() const
void setGuildLevel(uint32_t guildLevel)
void sendSpellCooldownPacket(SpellInfo const *spellInfo, const uint32_t duration, const bool isGcd)
float getManaRegenerationWhileCasting() const
UpdateManager m_updateMgr
uint32_t m_healthFromItems
void setAllowedToCreateCorpse(bool allowed)
void modifyBonuses(uint32_t type, int32_t val, bool apply)
void sendPvpCredit(uint32_t honor, uint64_t victimGuid, uint32_t victimRank)
void removeSummonSpell(uint32_t entry, uint32_t spellId)
void setSelectedGo(uint64_t guid)
void acceptQuest(uint64_t guid, uint32_t quest_id)
bool hasQuestSpell(uint32_t spellId)
void setProfessionSkillLine(uint32_t index, uint32_t value)
void cleanupAfterTaxiFlight()
void sendAuctionCommandResult(Auction *auction, uint32_t Action, uint32_t ErrorCode, uint32_t bidError=0)
void setFactionAtWar(uint32_t faction, bool set)
void setGlyph(uint16_t slot, uint32_t glyph)
void learnSkillSpells(uint16_t skillLine, uint16_t currentValue)
Charter const * getCharter(uint8_t charterType)
int8_t getSubGroupSlot() const
bool isOnGMTargetList(uint32_t guid) const
void setKnownCurrencies(uint64_t currencies)
virtual bool isClassPriest() const
void sendReportToGmMessage(std::string playerName, std::string damageLog)
bool hasAreaExplored(WDB::Structures::AreaTableEntry const *)
void setSpellCritPercentage(uint8_t school, float value)
void setTransferStatus(uint8_t status)
bool isSanctuaryFlagSet() const override
std::optional< uint8_t > findFreeStablePetSlot() const
bool isVisibleObject(uint64_t guid)
void sendLooter(Creature *creature)
uint32_t getExploredZone(uint32_t idx) const
std::string getBanReason() const
void addInstanceEnterTime(uint32_t instanceId, time_t enterTime)
bool hasTimedQuestInQuestSlot() const
float getModDamageDonePct(uint8_t shool) const
void setPlayerGender(uint8_t gender)
QuestLogEntry * getQuestLogBySlotId(uint32_t slotId) const
void setModDamageDonePct(float damagePct, uint8_t shool)
void sendLootUpdate(Object *object)
void removeHonor(uint32_t honorPoints, bool sendUpdate)
utf8_string getName() const
uint32_t getQuestLogEntryForSlot(uint8_t slot) const
uint16_t m_spellAreaUpdateTimer
void unEquipOffHandIfRequired()
std::set< Channel * > m_channels
void updateRageRegeneration(bool initialUpdate=false)
InstanceSaved * getInstanceSave(uint32_t mapId, bool isRaid)
void setResurrectMana(uint32_t mana)
void initialiseNoseLevel()
uint32_t m_flatStatModNeg[5]
void modModDamageDoneNegative(uint16_t school, int32_t value)
bool isTransferPending() const
void onKillUnitReputation(Unit *unit, bool innerLoop)
void applyFeralAttackPower(bool apply, Item *item=NULL)
void setPvpRank(uint8_t rank)
uint32_t getGroupInviterId() const
void setVisibleItemEnchantment(uint32_t slot, uint8_t pos, uint32_t enchantment)
std::array< ArenaTeam *, NUM_ARENA_TEAM_TYPES > m_arenaTeams
void setPendingBind(uint32_t instanceId, uint32_t bindTimer)
void addQuestSpell(uint32_t spellId)
void addArmorProficiency(uint32_t proficiency)
void copyAndSendDelayedPacket(WorldPacket *data)
bool loadSkills(QueryResult *result)
void setBgTeam(uint32_t team)
void setPlayerFieldBytes(uint32_t bytes)
void setMeleeCritPercentage(float value)
bool saveReputations(bool newCharacter, QueryBuffer *buf)
uint32_t getProfessionSkillLine(uint32_t index) const
uint32_t getVisibleItemEnchantment(uint32_t slot, uint8_t pos) const
void sendResetInstanceFailed(uint32_t reason, uint32_t MapId)
void removeSanctuaryFlag() override
void kickFromServer(uint32_t delay=0)
uint8_t getFreeQuestSlot() const
void setPctReputationMod(int32_t value)
void addSkillLine(uint16_t skillLine, uint16_t currentValue, uint16_t maxValue, bool noSpellLearning=false, bool initializeProfession=false)
float getDefenseChance(uint32_t opLevel)
void sendMessageToSet(WorldPacket *data, bool sendToSelf, bool sendToOwnTeam=false) override
void setFreePrimaryProfessionPoints(uint32_t points)
void _updateSkillBonusFields(const PlayerSkillFieldPosition fieldPosition, uint16_t tempBonus, uint16_t permBonus)
uint8_t m_battlegroundLastPetId
void sendEquipmentSetSaved(uint32_t setId, uint32_t setGuid)
Object * getSummonedObject() const
void sendPreventSchoolCast(uint32_t spellSchool, uint32_t timeMs)
void modModDamageDonePositive(uint16_t school, int32_t value)
bool compressAndSendUpdateBuffer(uint32_t size, const uint8_t *update_buffer)
void addQuestIdToFinishedDailies(uint32_t questId)
bool hasAnyQuestInQuestSlot() const
void die(Unit *unitAttacker, uint32_t damage, uint32_t spellId) override
void removeAuraVision(uint8_t auraVision)
void setSkillInfoBonusPermanent(uint32_t index, uint8_t offset, uint16_t bonus)
void smsg_TalentsInfo(bool SendPetTalents)
void addGarbageItem(std::unique_ptr< Item > item)
void applyForcedReaction(uint32_t faction_id, Standing rank, bool apply)
uint32_t m_resurrectHealth
void setAFKReason(std::string reason)
void resetInstances(uint8_t method, bool isRaid)
void sendFriendLists(uint32_t flags)
uint32_t getGlyph(uint16_t slot) const
uint32_t m_honorRolloverTime
uint8_t getPlayerFieldBytesMiscFlag() const
void _savePlayerCooldowns(QueryBuffer *buf)
void removeArmorProficiency(uint32_t proficiency)
bool loadReputations(QueryResult *result)
void removeFfaPvpFlag() override
uint32_t getModTargetResistance() const
void setTrackResource(uint32_t id)
uint64_t getPackSlotItemGuid(uint8_t slot) const
void _loadPet(QueryResult *result)
void setBuybackPriceSlot(uint8_t slot, uint32_t price)
void learnInitialSkills()
std::mutex m_mutexFriendList
FactionReputation * m_reputationByListId[128]
void setBankSlots(uint8_t slots)
void setArenaTeam(uint8_t type, ArenaTeam *arenaTeam)
float getSkillUpChance(uint16_t id)
void sendLoginVerifyWorldPacket(uint32_t mapId, float posX, float posY, float posZ, float orientation)
void resetHolyPowerTimer()
uint8_t getEnabledActionBars() const
PlayerTeam getTeam() const
uint8_t getHairStyle() const
void removeFromIgnoreList(uint32_t guid)
LocationVector m_lastGroupPosition
PetCache * getModifiablePetCache(uint8_t petId) const
void saveInstanceTimeRestrictions()
CachedCharacterInfo * m_playerInfo
int8_t getComboPoints() const
bool isLootableOnCorpse() const
uint8_t getLastBattlegroundPetId() const
uint32_t m_resurrectMapId
uint16_t getGroupStatus()
void setPlayerBytes(uint32_t bytes)
PlayerCreateInfo const * m_playerCreateInfo
bool activateTaxiPathTo(std::vector< uint32_t > const &nodes, Creature *npc=nullptr, uint32_t spellid=0)
virtual bool isClassHunter() const
void eventTimedQuestExpire(uint32_t questId)
void advanceSkillLine(uint16_t skillLine, uint16_t amount=1)
uint8_t m_talentSpecsCount
void setNoReagentCost(uint8_t index, uint32_t value)
uint8_t getArenaFaction() const
uint32_t getGuildRank() const
bool hasSpellGlobalCooldown(SpellInfo const *spellInfo)
void eventTalentHearthOfWildChange(bool apply)
virtual bool isClassShaman() const
UpdateManager & getUpdateMgr()
void areaExploredQuestEvent(uint32_t questId)
void setInitialPlayerProfessions()
void setFfaPvpFlag() override
void setHasWonRbgToday(bool value)
bool hasPvPTitle(RankTitles title)
void sendSmsgInitialSpells()
void setDuelStatus(uint8_t status)
bool canTrainAt(Trainer const *trainer)
void setSkillInfoStep(uint32_t index, uint8_t offset, uint16_t step)
std::map< uint8_t, uint8_t > m_cachedPetSlots
uint32_t getGuildTimestamp() const
void modModTargetResistance(int32_t value)
void loadFieldsFromString(const char *string, uint16_t firstField, uint32_t fieldsNum)
void modCoinage(int64_t coinage)
bool saveDeletedSpells(bool newCharacter, QueryBuffer *buf)
uint8_t getPlayerGender() const
void sendSavedInstances()
void setFarsightGuid(uint64_t farsightGuid)
void setDodgePercentage(float value)
uint32_t m_itemUpdateTimer
bool isInArenaTeam(uint8_t type) const
void setDuelState(uint8_t state)
bool isHostileBasedOnReputation(WDB::Structures::FactionEntry const *factionEntry)
std::map< uint32_t, Standing > m_forcedReactions
void incrementKills(uint32_t count=0)
void setHairStyle(uint8_t style)
WDB::Structures::ChrClassesEntry const * m_dbcClass
uint8_t m_talentActiveSpec
void setPlayerBytes2(uint32_t bytes2)
SpellSet m_deletedSpellSet
std::vector< uint32_t > m_gmPlayerTargetList
uint16_t m_partyUpdateTimer
void setMover(Unit *target)
void _loadQuestLogEntry(QueryResult *result)
uint32_t getVisibleItemEntry(uint32_t slot) const
void cancelTrade(bool sendToSelfAlso, bool silently=false)
void setInviteArenaTeamId(uint32_t id)
void displayDataStateList()
void setPackSlotItemGuid(uint8_t slot, uint64_t guid)
uint8_t getRaidDifficulty()
void setBGEntryPoint(float x, float y, float z, float o, uint32_t mapId, int32_t instanceId)
void setQuestSharerDbId(uint32_t id)
void clearCooldownsOnLine(uint32_t skillLine, uint32_t calledFrom)
void updateChanceFields()
void setBlockPercentage(float value)
uint64_t getBankBagSlotItemGuid(uint8_t slot) const
uint32_t getNoReagentCost(uint8_t index) const
void setShieldBlock(uint32_t value)
void setDungeonDifficulty(uint8_t diff)
virtual bool isClassWarrior() const
bool cooldownCanCast(ItemProperties const *itemProp, uint32_t spellIndex)
void regenerateHealth(bool inCombat)
std::mutex m_lockGMTargetList
uint32_t getInviteArenaTeamId() const
float getRuneRegen(uint8_t rune) const
void applyItemMods(Item *item, int16_t slot, bool apply, bool justBrokedown=false, bool skipStatApply=false)
uint32_t _fields[getSizeOfStructure(WoWPlayer)]
void sendTaxiNodeStatusMultiple()
bool hasItem(uint32_t itemId, uint32_t amount=1, bool checkBankAlso=false) const
void handleSpellLoot(uint32_t itemId)
void sendAreaTriggerMessage(const char *message,...)
void addGroupUpdateFlag(uint32_t flag)
uint8_t getDuelState() const
void setModHealingDone(uint32_t value)
void setGroupUpdateFlags(uint32_t flags)
uint32_t m_groupUpdateFlags
void removeArenaPoints(uint32_t arenaPoints, bool sendUpdate)
bool hasDeletedSpell(uint32_t spellId) const
void continueTaxiFlight() const
uint32_t m_resistanceModPctNeg[TOTAL_SPELL_SCHOOLS]
void sendCastFailedPacket(uint32_t spellId, uint8_t errorMessage, uint8_t multiCast, uint32_t extra1, uint32_t extra2=0)
void setExpertise(uint32_t value)
Item * storeItem(LootItem const *lootItem)
void setRaidDifficulty(uint8_t diff)
uint32_t getGroupUpdateFlags() const
std::mutex m_mutexFriendedBy
SpellSet const & getShapeshiftSpells() const
void sendLoot(uint64_t guid, uint8_t loot_type, uint32_t mapId)
void setPvpFlag() override
void sendMirrorTimer(MirrorTimerTypes mirrorType, uint32_t max, uint32_t current, int32_t regen)
uint32_t getArmorProficiency() const
void setAreaSpiritHealerGuid(uint64_t guid)
uint32_t getBindMapId() const
void setAuraVision(uint8_t auraVision)
bool isAppearingDisabled() const
void addSpell(uint32_t spellId, uint16_t fromSkill=0)
Player * getTradeTarget() const
uint64_t getVendorBuybackSlot(uint8_t slot) const
void applyPlayerRestState(bool apply)
uint32_t getTalentPointsFromQuests() const
void initialiseCharters()
void setOffHandExpertise(uint32_t value)
void clearQuest(uint32_t questId)
uint32_t getWatchedFaction() const
void setLifetimeHonorableKills(uint32_t kills)
void handleKnockback(Object *caster, float horizontal, float vertical) override
void loadInstanceTimeRestrictions()
uint32_t m_underwaterTime
void setSkillInfoBonusTemporary(uint32_t index, uint8_t offset, uint16_t bonus)
uint32_t getOffHandExpertise() const
uint8_t getFacialFeatures() const
virtual bool isClassWarlock() const
void removeQuestSpell(uint32_t spellId)
bool isSendOnlyRaidgroupSet() const
bool isInDisallowedMountForm() const
bool loadDeletedSpells(QueryResult *result)
bool hasPlayerFlags(uint32_t flags) const
void setUpdateBits(UpdateMask *updateMask, Player *target) const
void setModDamageDonePositive(uint16_t school, uint32_t value)
uint8_t getRestState() const
void sendResetFailedNotify(uint32_t mapid)
uint32_t m_flatResistanceModifierNeg[TOTAL_SPELL_SCHOOLS]
LocationVector getBindPosition() const
time_t m_fallDisabledUntil
uint32_t m_queuedBgInstanceId
void processPendingUpdates()
uint8_t getFreePetNumber()
bool canUseFlyingMountHere()
void setSanctuaryFlag() override
void setInitialPlayerData()
float getSpellCritFromSpell()
void addPetCache(std::unique_ptr< PetCache > petCache, uint8_t index)
bool hasSpell(uint32_t spellId) const
void setQueuedBgInstanceId(uint32_t id)
void setResurrectInstanceId(uint32_t id)
std::set< uint32_t > m_finishedQuests
std::optional< uint8_t > getPetIdFromSlot(uint8_t slot) const
void setLootableOnCorpse(bool lootable)
void addQuestToFinished(uint32_t questId)
void setOffHandCritPercentage(float value)
AIInterface * m_aiInterfaceWaypoint
void setCoinage(uint64_t coinage)
void setGlyphSlot(uint16_t slot, uint32_t glyph)
uint32_t m_healthFromSpell
void modifySkillMaximum(uint16_t skillLine, uint16_t maxValue)
std::map< uint32_t, std::set< uint32_t > > m_summonSpells
void initTaxiNodesForLevel()
bool hasOverlayUncovered(uint32_t overlayId)
uint32_t getQuestSharerByDbId() const
std::map< uint32_t, WeaponModifier > m_toCritChance
bool removeSpell(uint32_t spellId, bool moveToDeleted)
void sendNewDrunkStatePacket(uint32_t state, uint32_t itemId)
void setGuildId(uint32_t guildId)
uint32_t getHonorless() const
uint32_t m_talentPointsFromQuests
uint32_t m_AttackMsgTimer
WDB::Structures::ChrRacesEntry const * m_dbcRace
void setSkinColor(uint8_t color)
std::set< uint32_t > * getSummonSpells(uint32_t spellId)
InstancePlayerBind * getBoundInstance(uint32_t mapId, InstanceDifficulty::Difficulties difficulty, bool withExpired=false)
virtual bool isClassMonk() const
uint32_t m_underwaterLastDamage
uint32_t getPlayerBytes2() const
void onRemoveInRangeObject(Object *object) override
virtual bool isClassDeathKnight() const
void setArenaFaction(uint8_t faction)
GameObject * getSelectedGo() const
void learnTalent(uint32_t talentId, uint32_t talentRank)
uint32_t getQuestLogStateForSlot(uint8_t slot) const
uint32_t getRestStateXp() const
bool tryPutPetToSlot(uint8_t petId, uint8_t newSlot, bool sendErrors=true)
void addComboPoints(uint64_t targetGuid, int8_t points)
bool hasQuestFinished(uint32_t questId) const
std::set< uint32_t > getFinishedDailies() const
uint32_t m_mountVehicleId
uint16_t getSkillInfoBonusPermanent(uint32_t index, uint8_t offset) const
void sendMeetingStoneSetQueuePacket(uint32_t dungeonId, uint8_t status)
std::unique_ptr< ItemInterface > m_itemInterface
void setIsQueuedForRbg(bool value)
Standing const * getForcedReputationRank(WDB::Structures::FactionTemplateEntry const *factionTemplateEntry) const
void addPlayerFieldBytesMiscFlag(uint8_t miscFlag)
void updatePvPCurrencies()
static void changeLanguage(uint64_t guid, uint8_t race)
void addToIgnoreList(std::string name)
void setServersideDrunkValue(uint16_t newDrunkValue, uint32_t itemId=0)
uint32_t getInvitedByGuildId() const
std::array< Charter *, NUM_CHARTER_TYPES > m_charters
void applyItemProficienciesFromSpell(SpellInfo const *spellInfo, bool apply)
bool isFactionAtWar(WDB::Structures::FactionEntry const *factionEntry) const
void setSkillInfoMaxValue(uint32_t index, uint8_t offset, uint16_t max)
void setHasBgFlag(bool set)
void sendStopMirrorTimerPacket(MirrorTimerTypes type)
uint32_t m_statModPctPos[5]
void eventGroupFullUpdate()
void setStableSlotCount(uint8_t count)
uint32_t m_killsYesterday
uint32_t getWeaponProficiency() const
uint32_t m_championingFactionId
void modModHealingDone(int32_t value)
uint64_t getBankSlotItemGuid(uint8_t slot) const
void unsetCharter(uint8_t charterType)
std::mutex m_mutextDailies
void calcDeathDurabilityLoss(double percent)
void addDeletedSpell(uint32_t spellId)
void _addSpell(uint32_t spellId, uint16_t fromSkill=0, bool learningPreviousRanks=false, bool ignorePreviousRanks=false)
uint32_t getMaxPersonalRating()
void sendTeleportAckPacket(LocationVector position)
Player * getPlayerOwnerOrSelf() override
void sendRaidGroupOnly(uint32_t timeInMs, uint32_t type)
void setName(std::string name)
uint64_t m_areaSpiritHealerGuid
bool hasSpellWithAuraNameAndBasePoints(uint32_t auraName, uint32_t basePoints)
void eventSummonPet(Pet *summonPet)
void sendLevelupInfoPacket(uint32_t level, uint32_t hp, uint32_t mana, uint32_t stat0, uint32_t stat1, uint32_t stat2, uint32_t stat3, uint32_t stat4)
void setCreateBits(UpdateMask *updateMask, Player *target) const
void setSendOnlyRaidgroup(bool set)
bool canBuyAt(MySQLStructure::VendorRestrictions const *vendor)
void setLastBattlegroundPetId(uint8_t petId)
void sendDismountResultPacket(uint32_t result)
void sendWorldStateUpdate(uint32_t worldState, uint32_t value)
void speedCheatDelay(uint32_t delay)
bool isFfaPvpFlagSet() const override
void sendSmsgInitialFactions()
void endDuel(uint8_t condition)
void addShapeShiftSpell(uint32_t spellId)
void addPlayerFlags(uint32_t flags)
uint32_t m_underwaterState
uint32_t subtractRestXp(uint32_t amount)
void setVisibleItemFields(uint32_t slot, Item *item)
uint32_t getPlayerFieldBytes2() const
void setFactionStanding(uint32_t faction, int32_t value)
std::list< LoginAura > m_loginAuras
std::array< std::unique_ptr< QuestLogEntry >, MAX_QUEST_LOG_SIZE > m_questlog
virtual bool isClassRogue() const
bool safeTeleport(uint32_t mapId, uint32_t instanceId, const LocationVector &vec)
void setTutorialValueForId(uint8_t id, uint32_t value)
LocationVector getBGEntryPosition() const
void removeWeaponProficiency(uint32_t proficiency)
void setCurrencyTokenSlotItemGuid(uint8_t slot, uint64_t guid)
void sendAvailSpells(WDB::Structures::SpellShapeshiftFormEntry const *shapeshiftFormEntry, bool active)
std::set< uint32_t > quest_mobs
void sendItemPushResultPacket(bool created, bool recieved, bool sendtoset, uint8_t destbagslot, uint32_t destslot, uint32_t count, uint32_t entry, uint32_t suffix, uint32_t randomprop, uint32_t stack)
uint32_t * getPlayedTime()
std::vector< SocialFriends > m_socialIFriends
uint32_t getTalentResetsCount() const
void applyLevelInfo(uint32_t newLevel)
void removePlayerFieldBytesMiscFlag(uint8_t miscFlag)
void logIntoBattleground()
bool hasWonRbgToday() const
bool addNewFaction(WDB::Structures::FactionEntry const *factionEntry, int32_t standing, bool base)
void sendTotemCreatedPacket(uint8_t slot, uint64_t guid, uint32_t duration, uint32_t spellId)
void updateSkillMaximumValues()
uint16_t getSkillInfoMaxValue(uint32_t index, uint8_t offset) const
PetCacheMap const & getPetCacheMap() const
void removeFromGMTargetList(uint32_t guid)
uint32_t getShieldBlock() const
uint8_t getTransferStatus() const
void addSpellCooldown(SpellInfo const *spellInfo, Item const *itemCaster, Spell *castingSpell=nullptr, int32_t cooldownTime=0)
InstanceDifficulty::Difficulties getDifficulty(bool isRaid) const
bool hasSpellOnCooldown(SpellInfo const *spellInfo)
void setGuildAndGroupInfo()
void setRuneRegen(uint8_t rune, float regen)
void setInitialTalentPoints(bool talentsResetted=false)
void setExploredZone(uint32_t idx, uint32_t data)
bool canSignCharter(Charter const *charter, Player *requester)
time_t getFallDisabledUntil() const
bool isAlreadyInvitedToGroup() const
uint32_t m_honorYesterday
uint32_t m_duelCountdownTimer
void setSkillInfoId(uint32_t index, uint8_t offset, uint16_t id)
bool hasPendingBind() const
void setResistanceBuffModPositive(uint8_t type, uint32_t value)
void clearGlobalCooldown()
void addVisibleObject(uint64_t guid)
void setPendingBattleground(Battleground *bg)
void setLootGuid(const uint64_t &guid)
void handleDuelCountdown()
uint32_t m_flatResistanceModifierPos[TOTAL_SPELL_SCHOOLS]
uint32_t m_FirstTalentTreeLock
QuestLogEntry * getQuestLogByQuestId(uint32_t questId) const
void setVanityPetSlotItemGuid(uint8_t slot, uint64_t guid)
static UpdateMask m_visibleUpdateMask
bool isTeamAlliance() const
void updateKnownCurrencies(uint32_t itemId, bool apply)
uint32_t getPlayerFlags() const
std::map< uint32_t, uint32_t > m_wratings
const WoWPlayer * playerData() const
uint32_t getMountSpellId() const
void setInvitedByGuildId(uint32_t GuildId)
bool isQueuedForBg() const
void setWatchedFaction(uint32_t factionId)
uint32_t m_baseResistanceModPctPos[TOTAL_SPELL_SCHOOLS]
void setResurrectHealth(uint32_t health)
void calcResistance(uint8_t type)
LocationVector getCorpseLocation() const
PlayerTeam getBgTeam() const
void sendDelayedPacket(WorldPacket *data, bool deleteDataOnSend)
void setTalentPoints(uint32_t talentPoints, bool forBothSpecs=true)
void _addCategoryCooldown(uint32_t categoryId, uint32_t time, uint32_t SpellId, uint32_t ItemId)
void setActionButton(uint8_t button, uint32_t action, uint8_t type, uint8_t misc)
void setRangedCritPercentage(float value)
void setMapEntryPoint(uint32_t mapId)
std::unique_ptr< TradeData > m_TradeData
void addQuestToRemove(uint32_t questId)
void summonTemporarilyUnsummonedPet()
void handleBreathing(MovementInfo const &movement_info, WorldSession *session)
std::map< uint8_t, uint8_t > const & getPetCachedSlotMap() const
void modifySkillBonus(uint16_t skillLine, int16_t amount, bool permanentBonus)
uint32_t m_totalStatModPctPos[5]
void modFactionStanding(uint32_t faction, int32_t value)
bool isSummoningDisabled() const
void setFactionInactive(uint32_t faction, bool set)
virtual bool isClassDruid() const
uint32_t getSelfResurrectSpell() const
void setTemporarilyUnsummonedPetsOffline()
std::unique_ptr< TaxiPath > m_taxi
void advanceAllSkills(uint16_t amount=1)
void incrementHonorless()
uint32_t getGuildRankFromDB()
void addToFriendList(std::string name, std::string note)
void setMaxLevel(uint32_t level)
void addNoteToFriend(uint32_t guid, std::string note)
void modCombatRating(uint8_t combatRating, int32_t value)
void setSelfResurrectSpell(uint32_t spell)
void sendMovie(uint32_t movieId)
uint32_t getHonor() const
void sendExploreExperiencePacket(uint32_t areaId, uint32_t experience)
bool isQueuedForRbg() const
void sendPartyKillLogPacket(uint64_t killedGuid)
void setIsQueuedForBg(bool set)
void setBgQueueType(uint32_t type)
bool isAllowedToCreateCorpse() const
int32_t getFactionStanding(uint32_t faction)
Unit * getUnitOwnerOrSelf() override
bool m_isReadyToBeRemoved
void indoorCheckUpdate(uint32_t time)
uint8_t m_cannibalizeCount
void sendLogXpGainPacket(uint64_t guid, uint32_t normalXp, uint32_t restedXp, bool type)
uint32_t getBuybackTimestampSlot(uint8_t slot) const
void spawnPet(uint8_t petId)
virtual bool isClassPaladin() const
bool teleport(const LocationVector &vec, WorldMap *map)
Item * storeNewLootItem(uint8_t slot, Loot *loot)
void addToGMTargetList(uint32_t guid)
uint32_t getGuildId() const
uint32_t m_statModPctNeg[5]
SpellSet const & getDeletedSpellSet() const
uint32_t getFreeTalentPoints() const
std::set< uint32_t > m_removequests
void removeShapeShiftSpell(uint32_t spellId)
void Update(unsigned long time_passed)
void setResurrecterGuid(uint64_t guid)
uint32_t m_talentResetsCount
PlayerSpec & getActiveSpec()
bool isIgnored(uint32_t guid) const
void setPlayerFieldBytes2(uint32_t bytes)
void setParryPercentage(float value)
uint32_t m_pendingBindTimer
void tagUnit(Object *object)
uint16_t getSkillLineMax(uint16_t skillLine) const
void _loadPlayerCooldowns(QueryResult *result)
BoundInstancesMap m_boundInstances[InstanceDifficulty::MAX_DIFFICULTY]
uint8_t getDungeonDifficulty()
void saveToDB(bool newCharacter)
void setCombatRating(uint8_t combatRating, uint32_t value)
void removeSkillSpells(uint16_t skillLine)
void sendPlaySoundPacket(uint32_t soundId)
Battleground * m_pendingBattleground
void fillRandomBattlegroundReward(bool wonBattleground, uint32_t &honorPoints, uint32_t &arenaPoints)
void sendSpellModifierPacket(uint8_t spellType, std::vector< std::pair< uint8_t, float > > modValues, bool isPct)
uint32_t m_timeSyncClient
void setEnabledActionBars(uint8_t actionBarId)
void regeneratePlayerPowers(uint16_t diff)
void setPlayerBytes3(uint32_t bytes3)
void sendInstanceResetWarning(uint32_t mapid, InstanceDifficulty::Difficulties difficulty, uint32_t time, bool welcome)
bool hasEnoughCoinage(uint64_t coinage) const
QuestLogEntry * createQuestLogInSlot(QuestProperties const *questProperties, uint8_t slotId)
void setKnownPvPTitle(RankTitles title, bool set)
bool hasPetInSlot(uint8_t slot) const
uint32_t getExpertise() const
bool hasQueuedBgInstanceId() const
static PlayerBytes3_DrunkValue getDrunkStateByValue(uint16_t value)
ArenaTeam * getArenaTeam(uint8_t type)
uint32_t m_resistanceModPctPos[TOTAL_SPELL_SCHOOLS]
void setManaRegeneration(float value)
void setGuildRank(uint32_t guildRank)
bool hasQuestInQuestLog(uint32_t questId) const
void removePendingPlayer()
uint32_t getBgQueueType() const
void OnPushToWorld() override
void setLoginFlag(uint32_t flag)
void modFreePrimaryProfessionPoints(int32_t amount)
bool isPvpFlagSet() const override
void _eventAttack(bool offhand)
Standing getFactionStandingRank(uint32_t faction)
uint32_t getKillsToday() const
bool isPetRequiringTemporaryUnsummon() const
uint32_t getArenaPoints() const
void updateAutoRepeatSpell()
void eventKickFromServer()
uint32_t buildCreateUpdateBlockForPlayer(ByteBuffer *data, Player *target) override
This includes any nested objects we have, inventory for example.
Player * getPlayerOwner() override
uint32_t getLastBattlegroundPetSpell() const
void sendUpdateToOutOfRangeGroupMembers()
void setVisibleItemEntry(uint32_t slot, uint32_t entry)
uint8_t getSkinColor() const
uint32_t m_totalStatModPctNeg[5]
Object * m_summonedObject
bool hasQuestForItem(uint32_t itemId) const
void setGroupInviterId(uint32_t inviterId)
void sendCinematicCamera(uint32_t id)
void setSummonedObject(Object *summonedObject)
void sendPetUnlearnConfirmPacket()
void _saveQuestLogEntry(QueryBuffer *buf)
uint32_t getPlayerBytes() const
uint32_t getDuelTeam() const
void setBanned(uint32_t timestamp=4, std::string Reason="")
uint16_t m_holyPowerRegenerateTimer
void setQuestLogStateBySlot(uint8_t slot, uint32_t state)
bool hasOffHandWeapon() const
uint32_t getModHealingDone() const
void sendTalentResetConfirmPacket()
void OnPrePushToWorld() override
void sendDungeonDifficultyPacket()
void sendClientControlPacket(Unit *target, uint8_t allowMove)
void activateTalentSpec(uint8_t specId)
uint32_t m_grouIdpInviterId
void setBankBagSlotItemGuid(uint8_t slot, uint64_t guid)
void eventCannibalize(uint32_t amount)
uint32_t m_invitedByGuildId
void cooldownAddItem(ItemProperties const *itemProp, uint32_t spellIndex)
void removeVisibleObject(uint64_t guid)
void setTalentResetsCount(uint32_t value)
void updateManaRegeneration(bool initialUpdate=false)
void setQuestLogRequiredMobOrGoBySlot(uint8_t slot, uint32_t mobOrGoCount)
bool isAtGroupRewardDistance(Object *pRewardSource)
void setShieldBlockCritPercentage(float value)
void removePlayerFlags(uint32_t flags)
void _loadPetSpells(QueryResult *result)
void buildFlagUpdateForNonGroupSet(uint32_t index, uint32_t flag)
uint32_t m_indoorCheckTimer
uint32_t getTutorialValueById(uint8_t id)
uint32_t m_modBlockValueFromSpells
int32_t getBGEntryInstanceId() const
uint64_t getKnownCurrencies() const
uint32_t m_modBlockAbsorbValue
uint16_t m_serversideDrunkValue
uint32_t m_globalCooldown
void setModTargetPhysicalResistance(uint32_t value)
void setModTargetResistance(uint32_t value)
void outPacketToSet(uint16_t opcode, uint16_t length, const void *data, bool sendToSelf) override
bool isGroupLeader() const
uint32_t getQuestLogRequiredMobOrGoForSlot(uint8_t slot) const
uint64_t getCurrencyTokenSlotItemGuid(uint8_t slot) const
void setPhase(uint8_t command=PHASE_SET, uint32_t newPhase=1) override
std::vector< uint32_t > m_socialIgnoring
uint32_t getMaxLevel() const
LocationVector m_resurrectPosition
void setPlayerFieldBytesMiscFlag(uint8_t miscFlag)
void removeGarbageItems()
void applyRandomBattlegroundReward(bool wonBattleground)
uint8_t m_stableSlotCount
uint32_t getGlyphSlot(uint16_t slot) const
void setBuybackTimestampSlot(uint8_t slot, uint32_t timestamp)
void setResistanceBuffModNegative(uint8_t type, uint32_t value)
void decrementHonorless()
float calcRating(PlayerCombatRating t)
void joinedChannel(Channel *channel)
std::unique_ptr< SpeedCheatDetector > m_speedCheatDetector
uint32_t getMainMeleeDamage(uint32_t attackPowerOverride)
ReputationMap m_reputation
void broadcastMessage(const char *Format,...)
void sendGossipPoiPacket(float posX, float posY, uint32_t icon, uint32_t flags, uint32_t data, std::string name)
std::vector< uint32_t > m_socialFriendedByGuids
uint32_t m_baseResistanceModPctNeg[TOTAL_SPELL_SCHOOLS]
void sendInstanceDifficultyPacket(uint8_t difficulty)
uint8_t getAuraVision() const
void updateRunicPowerRegeneration(bool initialUpdate=false)
void setCorpseData(LocationVector position, int32_t instanceId)
std::string getAFKReason() const
uint32_t armorProficiency
bool hasQuestMob(uint32_t entry)
uint32_t getResistanceBuffModPositive(uint8_t type) const
void _Relocate(uint32_t mapid, const LocationVector &v, bool sendpending, bool force_new_world, uint32_t instance_id)
uint8_t m_dungeonDifficulty
void setRestStateXp(uint32_t xp)
std::unique_ptr< Mailbox > m_mailBox
void onModStanding(WDB::Structures::FactionEntry const *factionEntry, FactionReputation *reputation)
void resetFinishedDailies()
void setSession(WorldSession *session)
uint8_t getDrunkValue() const
PlayerCooldownMap m_cooldownMap[NUM_COOLDOWN_TYPES]
void sendForceMovePacket(UnitSpeedType speed_type, float speed)
const uint64_t & getLootGuid() const
WorldSession * getSession() const
SpellSet const & getSpellSet() const
uint32_t m_resurrectInstanceID
bool removeDeletedSpell(uint32_t spellId)
uint32_t getHonorYesterday() const
void loadFromDBProc(QueryResultVector &results)
std::mutex m_mutexIgnoreList
void removeFromFriendList(uint32_t guid)
void _savePet(QueryBuffer *buf, bool updateCurrentPetCache=false, Pet *currentPet=nullptr)
Battleground * getBattleground() const
void _spawnPet(PetCache const *petCache)
uint32_t getBGEntryMapId() const
void setNextLevelXp(uint32_t xp)
void displayCreatureSetForEntry(uint32_t _creatureEntry)
void giveXp(uint32_t xp, const uint64_t &guid, bool allowBonus)
int32_t getPctReputationMod() const
bool saveSkills(bool newCharacter, QueryBuffer *buf)
uint16_t getServersideDrunkValue() const
void setDuelArbiter(uint64_t guid)
void sendMountResultPacket(uint32_t result)
void sendEquipmentSetUseResultPacket(uint8_t result)
void addWeaponProficiency(uint32_t proficiency)
bool saveSpells(bool newCharacter, QueryBuffer *buf)
uint32_t getModDamageDoneNegative(uint16_t school) const
void unbindInstance(uint32_t mapid, InstanceDifficulty::Difficulties difficulty, bool unload=false)
void setBindPoint(float x, float y, float z, float o, uint32_t mapId, uint32_t zoneId)
void setFacialFeatures(uint8_t feature)
void eventTeleport(uint32_t mapId, LocationVector position, uint32_t instanceId=0)
LocationVector m_sentTeleportPosition
void sendCinematicOnFirstLogin()
void _savePetSpells(QueryBuffer *buf)
void loadFriendedByOthersList()
void setGlyphsEnabled(uint32_t glyphs)
void addToInRangeObjects(Object *object) override
uint32_t getBindZoneId() const
bool _removeSpell(uint32_t spellId, bool moveToDeleted, bool silently=false, bool removingPreviousRank=false, bool forceRemoveHigherRanks=false)
uint32_t getKillsYesterday() const
void setLastBattlegroundPetSpell(uint32_t petSpell)
void clearInRangeSets() override
void setMountVehicleId(uint32_t id)
uint32_t m_battlegroundLastPetSpell
uint64_t getVanityPetSlotItemGuid(uint8_t slot) const
float getShieldBlockCritPercentage() const
void sendTeleportPacket(LocationVector position)
bool create(CharCreate &charCreateContent)
bool isSpellFitByClassAndRace(uint32_t spell_id) const
uint64_t getInventorySlotItemGuid(uint8_t slot) const
void removeSkillLine(uint16_t skillLine)
int32_t m_pctReputationMod
void sendActionBars(uint8_t action)
uint32_t getQuestLogExpireTimeForSlot(uint8_t slot) const
uint32_t m_explorationTimer
float m_spellHasteRatingBonus
void updateNearbyQuestGameObjects()
void sendSummonRequest(uint32_t requesterId, uint32_t zoneId, uint32_t mapId, uint32_t instanceId, const LocationVector &position)
void removeIfVisiblePushOutOfRange(uint64_t guid)
uint32_t getInitialTeam() const
Battleground * getPendingBattleground() const
uint32_t GetFieldCount() const
uint32_t getCategoryRecoveryTime() const
bool hasSpellRanks() const
uint32_t getStartRecoveryTime() const
uint32_t getEffectApplyAuraName(uint8_t idx) const
uint32_t getDmgClass() const
uint32_t getAttributes() const
uint32_t getStartRecoveryCategory() const
uint32_t getRequiredShapeShift() const
int32_t getEffectBasePoints(uint8_t idx) const
int32_t getEquippedItemClass() const
uint32_t getRecoveryTime() const
SpellRankInfo const * getRankInfo() const
uint32_t getEffect(uint8_t idx) const
int32_t getEquippedItemSubClass() const
uint32_t getCategory() const
Unit * getUnitTarget() const
SpellCastResult prepare(SpellCastTargets *targets)
void setPvPFlags(bool set)
void setSanctuaryFlags(bool set)
void setPhase(uint8_t command, uint32_t newPhase)
std::vector< Summon * > const & getSummons() const
void setFFAPvPFlags(bool set)
bool isPermanentSummon() const
void setMaxRangedDamage(float damage)
void setStat(uint8_t stat, uint32_t value)
bool hasUnitStateFlag(uint32_t state_flag) const
bool hasAurasWithId(uint32_t auraId) const
void setCombatReach(float radius)
GameObject * getGameObject(uint32_t spellId) const
SpellCastResult castSpell(uint64_t targetGuid, uint32_t spellId, bool triggered=false)
Player * m_playerControler
float getAttackPowerMultiplier() const
void setMaxOffhandDamage(float damage)
uint64_t getNpcFlags() const
void removeProcTriggerSpell(uint32_t spellId, uint64_t casterGuid=0, uint64_t misc=0)
void setEmoteState(uint32_t id)
void interruptHealthRegeneration(uint32_t timeInMS)
uint32_t getMaxPower(PowerType type) const
void addUnitFlags(uint32_t unitFlags)
void setClass(uint8_t class_)
float m_baseRangedDamage[2]
float getAttackSpeedModifier(WeaponDamageType type) const
int32_t m_healDoneMod[TOTAL_SPELL_SCHOOLS]
uint32_t isStunned() const
void setHealthPct(uint32_t val)
void setMinOffhandDamage(float damage)
bool hasAuraState(AuraState state, SpellInfo const *spellInfo=nullptr, Unit const *caster=nullptr) const
PowerType getPowerType() const
void removeUnitFlags(uint32_t unitFlags)
void Update(unsigned long time_passed)
void setPositiveAuraLimit(uint8_t limit)
bool hasUnitFlags(uint32_t unitFlags) const
void setMountDisplayId(uint32_t id)
float getCombatReach() const
uint32_t getStat(uint8_t stat) const
float getSpeedRate(UnitSpeedType type, bool current) const
uint64_t getTargetGuid() const
bool canDualWield() const
void applySpellModifiers(SpellModifierType modType, T *value, SpellInfo const *spellInfo, Spell *castingSpell=nullptr, Aura *castingAura=nullptr)
void sendEnvironmentalDamageLogPacket(uint64_t guid, uint8_t type, uint32_t damage, uint64_t unk=0)
uint64_t getCharmGuid() const
void setOnMeleeSpell(uint32_t spellId, uint8_t ecn=0)
bool isAttackReady(WeaponDamageType type) const
void setPowerCostModifier(uint16_t school, uint32_t modifier)
void setMaxHealth(uint32_t maxHealth)
void modHealth(int32_t health)
uint32_t getDisplayId() const
uint32_t getOnMeleeSpell() const
float m_baseOffhandDamage[2]
virtual void OnPushToWorld()
virtual void onRemoveInRangeObject(Object *pObj)
void setGender(uint8_t gender)
SpellProc * addProcTriggerSpell(uint32_t spellId, uint32_t originalSpellId, uint64_t casterGuid, uint32_t procChance, SpellProcFlags procFlags, SpellExtraProcFlags exProcFlags, uint32_t const *spellFamilyMask, uint32_t const *procClassMask=nullptr, Aura *createdByAura=nullptr, Object *obj=nullptr)
void addGameObject(GameObject *gameObj)
uint8_t getGender() const
uint32_t getUnitFlags() const
void setCharmGuid(uint64_t guid)
void sendPowerUpdate(bool self)
void setMinRangedDamage(float damage)
void setBaseHealth(uint32_t baseHealth)
void modRangedAttackPowerMods(int32_t modifier)
void updateFocusRegeneration(bool initialUpdate=false)
void setMinDamage(float damage)
void setResistance(uint8_t type, uint32_t value)
uint64_t getCharmedByGuid() const
uint8_t getShapeShiftForm() const
uint32_t getBaseHealth() const
void setDisplayId(uint32_t id)
void setPowerCostMultiplier(uint16_t school, float multiplier)
void smsg_AttackStop(Unit *pVictim)
bool hasAuraWithAuraEffect(AuraEffect type) const
void removeAllAurasByIdForGuid(uint32_t auraId, uint64_t guid, AuraRemoveMode mode=AURA_REMOVE_BY_SERVER)
uint32_t getBaseMana() const
uint32_t getBaseAttackTime(uint8_t slot) const
void setSpeedRate(UnitSpeedType mtype, float rate, bool current)
void setAttackTimer(WeaponDamageType type, uint32_t time)
void addSimpleEnvironmentalDamageBatchEvent(EnviromentalDamage type, uint32_t damage, uint32_t absorbedDamage=0)
void setPower(PowerType type, uint32_t value, bool sendPacket=true, bool skipObjectUpdate=false)
uint32_t getChannelSpellId() const
void setAttackPowerMods(int32_t modifier)
void buildMovementPacket(ByteBuffer *data)
void setFaction(uint32_t factionId)
Aura * getAuraWithAuraSlot(uint16_t auraSlot) const
float getBlockFromSpell() const
void setAttackPowerMultiplier(float multiplier)
uint32_t getMaxHealth() const
virtual void setPhase(uint8_t command=PHASE_SET, uint32_t newPhase=1)
void setRangedAttackPowerMods(int32_t modifier)
float m_spellCritPercentage
virtual void setDeathState(DeathState state)
void setHealth(uint32_t health)
void setRangedAttackPowerMultiplier(float multiplier)
uint32_t getAttackTimer(WeaponDamageType type) const
uint32_t m_schoolImmunityList[TOTAL_SPELL_SCHOOLS]
void removeAllAurasById(uint32_t auraId, AuraRemoveMode mode=AURA_REMOVE_BY_SERVER)
void setHoverHeight(float height)
void removeAllAurasByAuraEffect(AuraEffect effect, uint32_t skipSpell=0, bool removeOnlyEffect=false, uint64_t casterGuid=0, AuraRemoveMode mode=AURA_REMOVE_BY_SERVER)
virtual void addToInRangeObjects(Object *pObj)
void sendFullAuraUpdate()
uint32_t getFactionTemplate() const
SummonHandler * getSummonInterface()
uint32_t getNativeDisplayId() const
int32_t getCalculatedAttackPower() const
void updateEnergyRegeneration(bool initialUpdate=false)
DeathState getDeathState() const
void removeAllNegativeAuras()
float getDodgeFromSpell() const
float m_spellCritChanceSchool[TOTAL_SPELL_SCHOOLS]
AuraArray const & getAuraList() const
ThreatManager & getThreatManager()
float getRangedAttackPowerMultiplier() const
void modMaxPower(PowerType type, int32_t value)
void playSpellVisual(uint32_t visual_id, uint32_t type)
void sendChatMessage(uint8_t type, uint32_t language, std::string msg, Unit *receiver=nullptr, uint32_t sessionLanguage=0)
AIInterface * getAIInterface() const
void setLevel(uint32_t level)
void setBoundingRadius(float radius)
void setMaxDamage(float damage)
uint32_t getClassMask() const
int32_t getCalculatedRangedAttackPower() const
void setRangedAttackPower(int32_t power)
uint32_t getHealth() const
uint32_t isFeared() const
uint64_t getChannelObjectGuid() const
void addAura(std::unique_ptr< Aura > aur)
void dismount(bool resummonPet=true)
uint32_t getPower(PowerType type) const
void setMoveRoot(bool set_root)
void modMaxHealth(int32_t maxHealth)
void modInvisibilityDetection(InvisibilityFlag flag, const int32_t amount)
void setNativeDisplayId(uint32_t id)
void setMaxPower(PowerType type, uint32_t value)
bool sendPeriodicAuraLog(const WoWGuid &casterGuid, const WoWGuid &targetGuid, SpellInfo const *spellInfo, uint32_t amount, uint32_t overKillOrOverHeal, uint32_t absorbed, uint32_t resisted, AuraEffect auraEffect, bool isCritical, uint32_t miscValue=0, float gainMultiplier=0.0f)
void removeAllAurasByAuraInterruptFlag(uint32_t auraInterruptFlag, uint32_t skipSpellId=0)
uint32_t getLevel() const
void setRace(uint8_t race)
DamageInfo strike(Unit *pVictim, WeaponDamageType weaponType, SpellInfo const *ability, int32_t add_damage, int32_t pct_dmg_mod, uint32_t exclusive_damage, bool disable_proc, bool skip_hit_check, bool force_crit=false, Spell *castingSpell=nullptr)
CombatHandler & getCombatHandler()
bool canReachWithAttack(Unit *unitTarget)
void setBaseMana(uint32_t baseMana)
float getModCastSpeed() const
AuraEffectList const & getAuraEffectList(AuraEffect effect) const
virtual void RemoveFromWorld(bool free_guid)
Remove object from world.
void setPowerType(uint8_t powerType)
void modAttackPowerMods(int32_t modifier)
uint32_t getRaceMask() const
MovementManager * getMovementManager()
uint32_t m_baseResistance[TOTAL_SPELL_SCHOOLS]
int32_t getInvisibilityDetection(InvisibilityFlag flag) const
void setDualWield(bool enable)
void setBaseAttackTime(uint8_t slot, uint32_t time)
void clearProcCooldowns()
void regeneratePower(PowerType type, uint16_t timePassed)
void setModCastSpeed(float modifier)
void setMoveCanFly(bool set_fly)
void setAttackPower(uint32_t value)
float getParryFromSpell() const
uint32_t getShapeShiftMask() const
void processPendingUpdates()
void pushOutOfRangeGuid(const WoWGuid &guid)
void queueDelayedPacket(std::unique_ptr< WorldPacket > packet)
void pushUpdateData(ByteBuffer *data, uint32_t updateCount)
void SetCount(uint32_t valuesCount)
void SetBit(const uint32_t index)
static uint32_t getGuidLowPartFromUInt64(uint64_t guid)
bool isGameObject() const
uint32_t getGuidLowPart() const
uint64_t getRawGuid() const
InstanceDifficulty::Difficulties getDifficulty() const
uint32_t getInstanceId() const
GameObject * getGameObject(uint32_t guid)
InstanceScript * getScript()
BaseMap * getBaseMap() const
WorldStatesHandler & getWorldStatesHandler()
void changeObjectLocation(Object *obj)
Creature * getCreature(uint32_t guid)
Player * getPlayer(uint32_t guid)
Unit * getUnit(const uint64_t &guid)
void getZoneAndAreaId(uint32_t phaseMask, uint32_t &zoneid, uint32_t &areaid, LocationVector const &pos)
GameObject * createGameObject(uint32_t entry)
DynamicObject * getDynamicObject(uint32_t guid)
uint16_t GetOpcode() const
void SetOpcode(uint16_t opcode)
void Initialize(uint16_t opcode, size_t newres=200)
void OutPacket(uint16_t opcode)
Player * m_loggingInPlayer
uint32_t GetAccountId() const
void sendDoFlight(uint32_t mountDisplayId, uint32_t path, uint32_t pathNode=0)
void sendVoidStorageTransferResult(uint8_t result)
bool HasFlag(uint32_t flag)
void sendTradeResult(TradeStatus result, uint64_t guid=0)
void SetInstance(uint32_t Instance)
void fullLogin(Player *player)
void SystemMessage(const char *format,...)
void SetPlayer(Player *plr)
void LogoutPlayer(bool Save)
void SendPacket(WorldPacket *packet)
bool hasPermissions() const
void sendCalendarRaidLockout(InstanceSaved const *save, bool add)
std::string GetAccountName()
void systemMessage(const std::string &format, Args &&... args)
bool HasGMPermissions() const
void BuildInitWorldStatesForZone(uint32_t _zone, uint32_t _area, WorldPacket &_data) const
FMT_CONSTEXPR auto bg(detail::color_type background) noexcept -> text_style
static void save(LexState *ls, int c)
static void check(LexState *ls, int c)
static void field(LexState *ls, ConsControl *cc)
static int add(void *a, void *b, void *c)
static int neg(void *a, void *b)
static l_noret error(LoadState *S, const char *why)
std::array< uint32_t, MAX_ACTION_SLOT > SmsgPetActionsArray
std::vector< uint32_t > SmsgPetSpellsVector
static constexpr uint32_t packPetActionButtonData(uint32_t spellId, uint8_t state)
std::vector< std::string > split(const std::string &source, const std::string &seperator)
Seperates string by seperator (one char) returns string vecotr.
void capitalize(std::string &str)
Capitalize word (uppercase first char, lowercase rest)
@ AREAC_ALLIANCE_TERRITORY
@ ERR_TaxiPlayerShapeshifted
@ ERR_TaxiPlayerAlreadyMounted
int32_t float2int32(float value)
long long GetTimeDifferenceToNow(const std::chrono::high_resolution_clock::time_point &start_time)
Returns the difference between start_time and now in milliseconds.
uint32_t getGameTime()
Returns generated time value for client packets.
std::chrono::high_resolution_clock::time_point TimeNow()
Returns the current point in time.
constexpr auto count() -> size_t
SERVER_DECL tm g_localTime
SERVER_DECL time_t UNIXTIME
WoWGuid highestBidderGuid
uint64_t getAuctionOutBid() const
the sum of outbid is (1% from current bid)*5, if bid is very small, it is 1c
WDB::Structures::SpellItemEnchantmentEntry const * Enchantment
uint32_t getLootId() const
uint32_t group_loot_rules
struct GameObjectProperties::@162::@167 chest
BindExtensionState extendState
ItemDamage Damage[MAX_ITEM_PROTO_DAMAGES]
std::map< uint32_t, int32_t > resistanceStatsMap
ItemSpell Spells[MAX_ITEM_PROTO_SPELLS]
std::map< uint32_t, int32_t > generalStatsMap
uint32_t ScalingStatsFlag
uint32_t ScalingStatsEntry
float ArmorDamageModifier
LooterSet const & getAllowedLooters() const
bool isAllowedForPlayer(Player const *player) const
WDB::Structures::ItemRandomPropertiesEntry const * iRandomProperty
WDB::Structures::ItemRandomSuffixEntry const * iRandomSuffix
ItemProperties const * itemproto
bool fillLoot(uint32_t lootId, LootTemplateMap const &tempelateStore, Player *lootOwner, bool personal, uint8_t lootMode=InstanceDifficulty::DUNGEON_NORMAL)
LootItem * lootItemInSlot(uint32_t lootslot, Player const *player, Personaltem **qitem=nullptr, Personaltem **ffaitem=nullptr)
uint64_t roundRobinPlayer
PersonaltemMap const & getPlayerFFAItems() const
void addLooter(uint32_t GUID)
PersonaltemMap const & getPlayerQuestItems() const
std::vector< LootItem > items
void itemRemoved(uint8_t slot)
std::vector< LootItem > quest_items
void writeMovementInfo(ByteBuffer &data, uint16_t opcode, float custom_speed=0.f, ExtraMovementStatusElement *extras=nullptr) const
ObjectGuid transport_guid
void clearTransportData()
bool hasMovementFlag(MovementFlags _flags) const
LocationVector const * getPosition() const
void setTransportData(ObjectGuid _guid, float x, float y, float z, float o, uint32_t time, int8_t seat)
std::list< CreateInfo_SkillStruct > skills
std::set< uint32_t > spell_cast_list
std::list< CreateInfo_ItemStruct > items
std::set< uint32_t > spell_list
std::list< CreateInfo_ActionBarStruct > actionbars
WDB::Structures::SkillLineEntry const * Skill
PlayerSkillFieldPosition FieldPosition
uint32_t required_itemcount[MAX_REQUIRED_QUEST_ITEM]
uint8_t count_required_item
uint8_t count_receiveitems
uint32_t receive_items[4]
uint32_t required_item[MAX_REQUIRED_QUEST_ITEM]
bool isSpellPartOfThisSpellRankChain(uint32_t spellId) const
uint32_t RequiredRepFaction
uint32_t RequiredRepValue
uint32_t RequiredSkillLine
uint32_t itemSuffixFactor
uint32_t itemRandomPropertyId
uint32_t ExtendedDisplayInfoID
bool isInstanceMap() const
char * map_name[NAME_PATTERN]
uint32_t statmodifier[10]
std::array< uint32_t, WOWPLAYER_SPELL_SCHOOL_COUNT > field_mod_damage_done_positive
std::array< uint32_t, WOWPLAYER_EXPLORED_ZONES_COUNT > explored_zones
player_bytes_3_union player_bytes_3
std::array< uint64_t, WOWPLAYER_BANK_SLOT_COUNT > bank_slot
std::array< uint64_t, WOWPLAYER_BUY_BACK_COUNT > vendor_buy_back_slot
std::array< uint32_t, WOWPLAYER_COMBAT_RATING_COUNT > field_combat_rating
uint32_t self_resurrection_spell
std::array< uint64_t, WOWPLAYER_PACK_SLOT_COUNT > pack_slot
std::array< uint32_t, WOWPLAYER_BUY_BACK_COUNT > field_buy_back_price
player_bytes_2_union player_bytes_2
uint32_t character_points_1
std::array< WoWPlayer_VisibleItem, WOWPLAYER_VISIBLE_ITEM_COUNT > visible_items
std::array< WoWPlayer_Quest, WOWPLAYER_QUEST_COUNT > quests
std::array< uint64_t, WOWPLAYER_KEYRING_SLOT_COUNT > key_ring_slot
player_field_bytes_2_union player_field_bytes_2
std::array< uint32_t, WOWPLAYER_SPELL_SCHOOL_COUNT > field_mod_damage_done_negative
std::array< uint32_t, WOWPLAYER_BUY_BACK_COUNT > field_buy_back_timestamp
player_bytes_union player_bytes
std::array< uint32_t, WOWPLAYER_SPELL_SCHOOL_COUNT > resistance_buff_mod_positive
player_field_bytes_union player_field_bytes
uint32_t field_lifetime_honorable_kills
std::array< float, WOWPLAYER_SPELL_SCHOOL_COUNT > field_mod_damage_done_pct
std::array< uint32_t, WOWPLAYER_SPELL_SCHOOL_COUNT > resistance_buff_mod_negative
std::array< uint64_t, WOWPLAYER_BANK_BAG_SLOT_COUNT > bank_bag_slot
std::array< WoWPlayer_SkillInfo, WOWPLAYER_SKILL_INFO_COUNT > skill_info
std::array< uint64_t, WOWPLAYER_INVENTORY_SLOT_COUNT > inventory_slot
uint32_t character_points_2
uint32_t field_watched_faction_idx
uint8_t enabled_action_bars
struct player_bytes_2_union::parts s
struct player_bytes_3_union::parts s
struct player_bytes_union::parts s
struct player_field_bytes_2_union::parts s
struct player_field_bytes_union::parts s
unsigned __int64 uint64_t